NUnit.Framework.Assert.AreEqual(uint, uint, string)

Here are the examples of the csharp api class NUnit.Framework.Assert.AreEqual(uint, uint, string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

1. Example

Project: GEDKeeper
Source File: SCCTests.cs
View license
[Test]
        public void Test_Common()
        {
            uint source = 0xabbccdd;
            byte[] arrayNew = SCCrypt.MoveL2S(source, 4);
            Assert.AreEqual(new byte[] { 221, 204, 187, 10 }, arrayNew, "test #1");

            source = 0xbadf00d;
            arrayNew = SCCrypt.MoveL2S(source, 4);
            Assert.AreEqual(new byte[] { 13, 240, 173, 11 }, arrayNew, "test #2");

            source = 0x1020304;
            arrayNew = SCCrypt.MoveL2S(source, 2);
            Assert.AreEqual(new byte[] { 4, 3 }, arrayNew, "test #3");

            source = 0xff00ff00;
            arrayNew = SCCrypt.MoveL2S(source, 1);
            Assert.AreEqual(new byte[] { 0 }, arrayNew, "test #4");

            byte[] array = new byte[] {0x0d, 0xf0, 0xad, 0xb};
            uint sourceNew = SCCrypt.MoveS2L(array, 4);
            Assert.AreEqual(195948557, sourceNew, "test #5");

            array = new byte[] { 0x1, 0x2, 0x3, 0x4 };
            sourceNew = SCCrypt.MoveS2L(array, 3);
            Assert.AreEqual(197121, sourceNew, "test #6");
        }

2. Example

Project: f-spot
Source File: UpdaterTests.cs
View license
private void CheckPhoto (FSpotDatabaseConnection db, uint id, uint time, string base_uri, string filename, string description, uint roll_id, uint default_version_id, uint rating)
        {
            var reader = db.Query ("SELECT id, time, base_uri, filename, description, roll_id, default_version_id, rating FROM photos WHERE id = " + id);
            var found = false;
            while (reader.Read ()) {
                Assert.AreEqual (id, Convert.ToUInt32 (reader[0]), "id on photo "+id);
                Assert.AreEqual (time, Convert.ToUInt32 (reader[1]), "time on photo "+id);
                Assert.AreEqual (base_uri, reader[2], "base_uri on photo "+id);
                Assert.AreEqual (filename, reader[3], "filename on photo "+id);
                Assert.AreEqual (description, reader[4], "description on photo "+id);
                Assert.AreEqual (roll_id, Convert.ToUInt32 (reader[5]), "roll_id on photo "+id);
                Assert.AreEqual (default_version_id, Convert.ToUInt32 (reader[6]), "default_version_id on photo "+id);
                Assert.AreEqual (rating, Convert.ToUInt32 (reader[7]), "rating on photo "+id);
                found = true;
            }
            Assert.IsTrue (found, "photo "+id+" missing");
        }

3. Example

Project: f-spot
Source File: UpdaterTests.cs
View license
private void CheckPhotoVersion (FSpotDatabaseConnection db, uint photo_id, uint version_id, string name, string base_uri, string filename, string import_md5, uint is_protected)
        {
            var reader = db.Query ("SELECT photo_id, version_id, name, base_uri, filename, import_md5, protected FROM photo_versions WHERE photo_id = " + photo_id + " AND version_id = " + version_id);
            var found = false;
            while (reader.Read ()) {
                Assert.AreEqual (photo_id, Convert.ToUInt32 (reader[0]), "photo_id on photo version "+photo_id+"/"+version_id);
                Assert.AreEqual (version_id, Convert.ToUInt32 (reader[1]), "version_id on photo version "+photo_id+"/"+version_id);
                Assert.AreEqual (name, reader[2], "name on photo version "+photo_id+"/"+version_id);
                Assert.AreEqual (base_uri, reader[3], "base_uri on photo version "+photo_id+"/"+version_id);
                Assert.AreEqual (filename, reader[4], "filename on photo version "+photo_id+"/"+version_id);
                Assert.AreEqual (import_md5, reader[5], "import_md5 on photo version "+photo_id+"/"+version_id);
                Assert.AreEqual (is_protected, Convert.ToUInt32 (reader[6]), "protected on photo version "+photo_id+"/"+version_id);
                found = true;
            }
            Assert.IsTrue (found, "photo version "+photo_id+"/"+version_id+" missing");
        }

4. Example

Project: libpalaso
Source File: XmlUtilsTests.cs
View license
[TestCase("1,2", "'1,2' should return two integers in the array", "Expected order in array is: '1,2'")]
		[TestCase("2,1", "'2,1' should return two integers in the array", "Expected order in array is: '2,1'")]
		public void GetMandatoryUIntegerListAttributeValue_Has_Correct_List(string sourceAttrData, string errorMessageCount, string errorMessageOrder)
		{
			var element = new XElement("element", new XAttribute("intArray", sourceAttrData));
			var resultArray = XmlUtils.GetMandatoryUIntegerListAttributeValue(element, "intArray");
			var sourceArray = sourceAttrData.Split(',');
			Assert.AreEqual(sourceArray.Length, resultArray.Length, errorMessageCount);

			for (var idx = 0; idx < sourceArray.Length; idx++)
			{
				Assert.AreEqual(uint.Parse(sourceArray[idx], CultureInfo.InvariantCulture), resultArray[idx], errorMessageOrder);
			}
		}

5. Example

Project: f-spot
Source File: UpdaterTests.cs
View license
private void CheckTag (FSpotDatabaseConnection db, uint id, string name, uint cat_id, int is_cat, int sort, string icon)
        {
            var reader = db.Query ("SELECT id, name, category_id, is_category, sort_priority, icon FROM tags WHERE id = " + id);
            var found = false;
            while (reader.Read ()) {
                Assert.AreEqual (id, Convert.ToUInt32 (reader[0]), "id on tag "+id);
                Assert.AreEqual (name, reader[1], "name on tag "+id);
                Assert.AreEqual (cat_id, Convert.ToUInt32 (reader[2]), "category_id on tag "+id);
                Assert.AreEqual (is_cat, Convert.ToInt32 (reader[3]), "is_cat on tag "+id);
                Assert.AreEqual (sort, reader[4], "sort_priority on tag "+id);
                Assert.AreEqual (icon, reader[5], "icon on tag "+id);
                found = true;
            }
            Assert.IsTrue (found, "tag "+id+" missing");
        }

6. Example

Project: packetnet
Source File: MacFrameTest.cs
View license
[Test]
            public void FCSTest ()
            {
                var dev = new CaptureFileReaderDevice ("../../CaptureFiles/80211_association_request_frame.pcap");
                dev.Open ();
                var rawCapture = dev.GetNextPacket ();
                dev.Close ();

                // check that the fcs can be calculated correctly
                Packet p = Packet.ParsePacket (rawCapture.LinkLayerType, rawCapture.Data);
                AssociationRequestFrame frame = (AssociationRequestFrame)p.PayloadPacket;
                Assert.AreEqual (0xde82c216, frame.FrameCheckSequence, "FCS mismatch");
                Assert.IsTrue (frame.FCSValid);

                // adjust the fcs of the packet and check that the FCSValid property returns false
                frame.FrameCheckSequence = 0x1;
                Assert.IsFalse (frame.FCSValid);                
            }