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

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

2 Examples 7

1. Example

Project: NPOI
Source File: TestULongField.cs
View license
[Test]
        public void TestWriteToBytes()
        {
            ULongField field = new ULongField(0);
            byte[]    array = new byte[ 8 ];

            for (int j = 0; j < _test_array.Length; j++)
            {
                field.Value=_test_array[ j ];
                field.WriteToBytes(array);
                ulong val = (( ulong ) array[ 7 ]) << 56;

                val &=0xFF00000000000000L;
                val += ((( ulong ) array[ 6 ]) << 48) & 0x00FF000000000000L;
                val += ((( ulong ) array[ 5 ]) << 40) & 0x0000FF0000000000L;
                val += ((( ulong ) array[ 4 ]) << 32) & 0x000000FF00000000L;
                val += ((( ulong ) array[ 3 ]) << 24) & 0x00000000FF000000L;
                val += ((( ulong ) array[ 2 ]) << 16) & 0x0000000000FF0000L;
                val += ((( ulong ) array[ 1 ]) << 8) & 0x000000000000FF00L;
                val += ((( ulong ) array[ 0 ]) & 0x00000000000000FFL);
                Assert.AreEqual(_test_array[ j ], val,"testing ");
            }
        }

2. Example

Project: Eluant
Source File: Functions.cs
View license
[Test]
        public void TypeMapping()
        {
            bool called = false;
            TypeMappingTestDelegate cb = (a, b, c, d, e, f, g) => {
                Assert.AreEqual(10, a, "a");
                Assert.AreEqual(20, b, "b");
                Assert.AreEqual(0.5, c, "c");
                Assert.AreEqual("foobar", d, "d");
                Assert.AreEqual("dingus", e["widget"].ToString(), "e");
                Assert.AreEqual(true, f, "f");
                Assert.IsNull(g, "g");

                called = true;
            };

            using (var runtime = new LuaRuntime()) {
                using (var wrapper = runtime.CreateFunctionFromDelegate(cb)) {
                    runtime.Globals["callback"] = wrapper;
                }

                runtime.DoString("callback(10, 20, 0.5, 'foobar', { widget='dingus' }, true, nil)");
            }

            Assert.IsTrue(called, "called");
        }