NUnit.Framework.Assert.AreSame(object, object, string)

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

43 Examples 7

1. Example

Project: yacq
Source File: ChainingAssertion.NUnit.cs
View license
public static void IsSameReferenceAs<T>(this T actual, T expected, string message = "")
        {
            Assert.AreSame(expected, actual, message);
        }

2. Example

Project: spring-net
Source File: NUnitAdapter.cs
View license
public static void AssertSame(string message, object expected, object actual)
		{
			Assert.AreSame(expected, actual, message);
		}

3. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void AssertSame(string message, Object expected, Object actual)
		{
			NUnit.Framework.Assert.AreSame(expected, actual, message);
		}

4. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void AssertSame(string message, Object expected, Object actual)
		{
			NUnit.Framework.Assert.AreSame(expected, actual, message);
		}

5. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void AssertSame(Object expected, Object actual) 
		{
			NUnit.Framework.Assert.AreSame(expected, actual, string.Empty);
		}

6. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void AssertSame(Object expected, Object actual) 
		{
			NUnit.Framework.Assert.AreSame(expected, actual, string.Empty);
		}

7. Example

View license
public static void IsSameReferenceAs<T>(this T actual, T expected, string message = "")
        {
            Assert.AreSame(expected, actual, message);
        }

8. Example

View license
public static void IsSameReferenceAs<T>(this T actual, T expected, string message = "")
        {
            Assert.AreSame(expected, actual, message);
        }

9. Example

Project: pgina
Source File: SystemInfoTest.cs
View license
[Test, ExpectedException(typeof(TypeLoadException))] public void TestGetTypeFromStringFails2()
		{
			Type t = null;
			
			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST", false, false);
			Assert.AreSame(null, t, "Test explicit case sensitive fails type load");

			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST", true, false);
		}

10. Example

Project: pgina
Source File: SystemInfoTest.cs
View license
[Test] public void TestGetTypeFromStringRelative()
		{
			Type t = null;
			
			t = SystemInfo.GetTypeFromString("log4net.Tests.Util.SystemInfoTest", false, false);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case sensitive type load");

			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load caps");

			t = SystemInfo.GetTypeFromString("log4net.tests.util.systeminfotest", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load lower");
		}

11. Example

Project: pgina
Source File: SystemInfoTest.cs
View license
[Test] public void TestGetTypeFromStringSearch()
		{
			Type t = null;
			
			t = SystemInfo.GetTypeFromString("log4net.Util.SystemInfo", false, false);
			Assert.AreSame(typeof(SystemInfo), t, "Test explicit case sensitive type load");

			t = SystemInfo.GetTypeFromString("LOG4NET.UTIL.SYSTEMINFO", false, true);
			Assert.AreSame(typeof(SystemInfo), t, "Test explicit case in-sensitive type load caps");

			t = SystemInfo.GetTypeFromString("log4net.util.systeminfo", false, true);
			Assert.AreSame(typeof(SystemInfo), t, "Test explicit case in-sensitive type load lower");
		}

12. Example

Project: pgina
Source File: SystemInfoTest.cs
View license
[Test, ExpectedException(typeof(TypeLoadException))] public void TestGetTypeFromStringFails1()
		{
			Type t = null;
			
			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS", false, false);
			Assert.AreSame(null, t, "Test explicit case sensitive fails type load");

			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS", true, false);
		}

13. Example

Project: pgina
Source File: SystemInfoTest.cs
View license
[Test] public void TestGetTypeFromStringFullyQualified()
		{
			Type t = null;
			
			t = SystemInfo.GetTypeFromString("log4net.Tests.Util.SystemInfoTest,log4net.Tests", false, false);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case sensitive type load");

			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load caps");

			t = SystemInfo.GetTypeFromString("log4net.tests.util.systeminfotest,log4net.tests", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load lower");
		}

14. Example

Project: NClass
Source File: SystemInfoTest.cs
View license
[Test][Platform(Include="Win")]
		public void TestGetTypeFromStringCaseInsensitiveOnAssemblyName()
		{
			Type t;

			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load caps");

			t = SystemInfo.GetTypeFromString("log4net.tests.util.systeminfotest,log4net.tests", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load lower");
		}

15. Example

Project: NClass
Source File: SystemInfoTest.cs
View license
[Test, ExpectedException(typeof(TypeLoadException))]
		public void TestGetTypeFromStringFails1()
		{
			Type t;

			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS", false, false);
			Assert.AreSame(null, t, "Test explicit case sensitive fails type load");

			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS", true, false);
		}

16. Example

Project: NClass
Source File: SystemInfoTest.cs
View license
[Test]
		public void TestGetTypeFromStringFullyQualified()
		{
			Type t;

			t = SystemInfo.GetTypeFromString("log4net.Tests.Util.SystemInfoTest,log4net.Tests", false, false);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case sensitive type load");

			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,log4net.Tests", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load caps");

			t = SystemInfo.GetTypeFromString("log4net.tests.util.systeminfotest,log4net.Tests", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load lower");
		}

17. Example

Project: logging-log4net
Source File: SystemInfoTest.cs
View license
[Test][Platform(Include="Win")]
		public void TestGetTypeFromStringCaseInsensitiveOnAssemblyName()
		{
			Type t;

			t = GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load caps");

			t = GetTypeFromString("log4net.tests.util.systeminfotest,log4net.tests", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load lower");
		}

18. Example

Project: logging-log4net
Source File: SystemInfoTest.cs
View license
[Test]
		public void TestGetTypeFromStringFullyQualified()
		{
			Type t;

			t = GetTypeFromString("log4net.Tests.Util.SystemInfoTest,log4net.Tests", false, false);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case sensitive type load");

			t = GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,log4net.Tests", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load caps");

			t = GetTypeFromString("log4net.tests.util.systeminfotest,log4net.Tests", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load lower");
		}

19. Example

Project: NClass
Source File: SystemInfoTest.cs
View license
[Test]
		public void TestGetTypeFromStringSearch()
		{
			Type t;

			t = SystemInfo.GetTypeFromString("log4net.Util.SystemInfo", false, false);
			Assert.AreSame(typeof(SystemInfo), t, "Test explicit case sensitive type load");

			t = SystemInfo.GetTypeFromString("LOG4NET.UTIL.SYSTEMINFO", false, true);
			Assert.AreSame(typeof(SystemInfo), t, "Test explicit case in-sensitive type load caps");

			t = SystemInfo.GetTypeFromString("log4net.util.systeminfo", false, true);
			Assert.AreSame(typeof(SystemInfo), t, "Test explicit case in-sensitive type load lower");
		}

20. Example

Project: logging-log4net
Source File: SystemInfoTest.cs
View license
[Test]
		public void TestGetTypeFromStringRelative()
		{
			Type t;

			t = GetTypeFromString("log4net.Tests.Util.SystemInfoTest", false, false);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case sensitive type load");

			t = GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load caps");

			t = GetTypeFromString("log4net.tests.util.systeminfotest", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load lower");
		}

21. Example

Project: logging-log4net
Source File: SystemInfoTest.cs
View license
[Test, ExpectedException(typeof(TypeLoadException))]
		public void TestGetTypeFromStringFails2()
		{
			Type t;

			t = GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST", false, false);
			Assert.AreSame(null, t, "Test explicit case sensitive fails type load");

			t = GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST", true, false);
		}

22. Example

Project: logging-log4net
Source File: SystemInfoTest.cs
View license
[Test, ExpectedException(typeof(TypeLoadException))]
		public void TestGetTypeFromStringFails1()
		{
			Type t;

			t = GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS", false, false);
			Assert.AreSame(null, t, "Test explicit case sensitive fails type load");

			t = GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST,LOG4NET.TESTS", true, false);
		}

23. Example

Project: NClass
Source File: SystemInfoTest.cs
View license
[Test, ExpectedException(typeof(TypeLoadException))]
		public void TestGetTypeFromStringFails2()
		{
			Type t;

			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST", false, false);
			Assert.AreSame(null, t, "Test explicit case sensitive fails type load");

			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST", true, false);
		}

24. Example

Project: NClass
Source File: SystemInfoTest.cs
View license
[Test]
		public void TestGetTypeFromStringRelative()
		{
			Type t;

			t = SystemInfo.GetTypeFromString("log4net.Tests.Util.SystemInfoTest", false, false);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case sensitive type load");

			t = SystemInfo.GetTypeFromString("LOG4NET.TESTS.UTIL.SYSTEMINFOTEST", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load caps");

			t = SystemInfo.GetTypeFromString("log4net.tests.util.systeminfotest", false, true);
			Assert.AreSame(typeof(SystemInfoTest), t, "Test explicit case in-sensitive type load lower");
		}

25. Example

View license
[Test]
        public void RaiseCanExecuteChanged_InvokesCanExecuteChangedHandler()
        {
            Object sender = null;
            EventArgs args = null;
            _translatableCommandBase.CanExecuteChanged += (s, a) =>
            {
                sender = s;
                args = a;
            };

            _translatableCommandBase.InvokeRaiseCanExecuteChangedForTesting();

            Assert.AreEqual(EventArgs.Empty, args, "EventArgs not empty");
            Assert.AreSame(_translatableCommandBase, sender, "Sender not this");
        }

26. Example

Project: logging-log4net
Source File: SystemInfoTest.cs
View license
[Test]
		public void TestGetTypeFromStringSearch()
		{
			Type t;

			t = GetTypeFromString("log4net.Util.SystemInfo", false, false);
			Assert.AreSame(typeof(SystemInfo), t,
									   string.Format("Test explicit case sensitive type load found {0} rather than {1}",
													 t.AssemblyQualifiedName, typeof(SystemInfo).AssemblyQualifiedName));

			t = GetTypeFromString("LOG4NET.UTIL.SYSTEMINFO", false, true);
			Assert.AreSame(typeof(SystemInfo), t, "Test explicit case in-sensitive type load caps");

			t = GetTypeFromString("log4net.util.systeminfo", false, true);
			Assert.AreSame(typeof(SystemInfo), t, "Test explicit case in-sensitive type load lower");
		}

27. Example

Project: nesper
Source File: ArrayAssertionUtil.cs
View license
public static void AssertSameExactOrder<T>(IList<T> expectedValues, IList<T> data)
        {
            if ((expectedValues == null) && (data == null)) {
                return;
            }
            if (((expectedValues == null) && (data != null)) ||
                ((expectedValues != null) && (data == null))) {
                Assert.Fail();
            }

            Assert.AreEqual(expectedValues.Count, data.Count);

            for (int i = 0; i < expectedValues.Count; i++) {
                Assert.AreSame(expectedValues[i], data[i], "at element " + i);
            }
        }

28. Example

Project: nesper
Source File: ArrayAssertionUtil.cs
View license
public static void AssertSameExactOrder<T>(IList<T> expectedValues, IList<T> data)
        {
            if ((expectedValues == null) && (data == null)) {
                return;
            }
            if (((expectedValues == null) && (data != null)) ||
                ((expectedValues != null) && (data == null))) {
                Assert.Fail();
            }

            Assert.AreEqual(expectedValues.Count, data.Count);

            for (int i = 0; i < expectedValues.Count; i++) {
                Assert.AreSame(expectedValues[i], data[i], "at element " + i);
            }
        }

29. Example

Project: spring-net
Source File: SimplePoolTest.cs
View license
[Test]
		public void WaitOnBorrowWhenExausted()
		{
			int n = 100;
			object[] objects = new object[n];
			pool = new SimplePool(new MyFactory(), n);
			for (int i = 0; i < n; i++)
			{
				objects[i] = pool.BorrowObject();
			}
			Latch latch = new Latch();
			ISync sync = new Latch();
			Helper helper = new Helper(latch, sync, pool);
			Thread thread = new Thread(new ThreadStart(helper.UsePool));
			thread.Start();
			Assert.AreEqual(n, pool.NumActive);
			Assert.AreEqual(0, pool.NumIdle);
			object released = objects[n - 1];
			pool.ReturnObject(released);
			latch.Acquire();
			Assert.AreEqual(n, pool.NumActive);
			Assert.AreEqual(0, pool.NumIdle);
			Assert.IsNotNull(helper.gotFromPool, "helper did not get from pool");
			Assert.AreSame(released, helper.gotFromPool, "got unexpected object");
		}

30. Example

View license
[Test]
        public void ReturnsThisWhenProxyIsIncompatible() 
        {
		    FooBar obj = new FooBar();

		    AdvisedSupport advised = new AdvisedSupport();
            advised.Target = obj;
            advised.Interfaces = new Type[] { typeof(IFoo) };

            IFoo proxy = (IFoo)CreateProxy(advised);

            Assert.AreSame(obj, proxy.GetBarThis(),
                "Target should be returned when return types are incompatible");
		    Assert.AreSame(proxy, proxy.GetFooThis(),
                "Proxy should be returned when return types are compatible");
	    }

31. Example

Project: NClass
Source File: CyclicBufferTest.cs
View license
[Test]
		public void TestSize1()
		{
			CyclicBuffer cb = new CyclicBuffer(1);

			Assert.AreEqual(0, cb.Length, "Empty Buffer should have length 0");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should have max size 1");

			LoggingEvent event1 = new LoggingEvent(null, null, null, null, null, null);
			LoggingEvent event2 = new LoggingEvent(null, null, null, null, null, null);

			LoggingEvent discardedEvent = cb.Append(event1);

			Assert.IsNull(discardedEvent, "No event should be discarded untill the buffer is full");
			Assert.AreEqual(1, cb.Length, "Buffer should have length 1");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should still have max size 1");


			discardedEvent = cb.Append(event2);

			Assert.AreSame(event1, discardedEvent, "Expect event1 to now be discarded");
			Assert.AreEqual(1, cb.Length, "Buffer should still have length 1");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should really still have max size 1");

			LoggingEvent[] discardedEvents = cb.PopAll();

			Assert.AreEqual(1, discardedEvents.Length, "Poped events length should be 1");
			Assert.AreSame(event2, discardedEvents[0], "Expect event2 to now be popped");
			Assert.AreEqual(0, cb.Length, "Buffer should be back to length 0");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should really really still have max size 1");
		}

32. Example

Project: memcache-driver
Source File: GetRequestTests.cs
View license
[Test]
        public void GetRequestTest()
        {
            byte[] message = null;
            var request = new GetRequest(CallBackPolicy.AnyOK)
            {
                Key = "Hello".Select(c => (byte)c).ToArray(),
                RequestId = 0,
                CallBack = (s, m) => message = m,
            };

            var queryBuffer = request.GetQueryBuffer();

            CollectionAssert.AreEqual(GET_QUERY, queryBuffer, "The get query buffer is different from the expected one");

            var header = new MemcacheResponseHeader { Opcode = Opcode.Get, Status = Status.NoError };
            Assert.DoesNotThrow(() => request.HandleResponse(header, null, GET_FLAG, GET_MESSAGE), "Handle request should not throw an exception");

            Assert.AreSame(GET_MESSAGE, message, "Sent message and the one returned by the request are different");
        }

33. Example

View license
private void connection_release_mode_auto()
    {
        //with conversation and "connection.releas/n ..... /n //View Source file for more details /n }

34. Example

View license
private void connection_release_mode_on_close()
    {
        //forcing "on_close" by reflection.
  /n ..... /n //View Source file for more details /n }

35. Example

Project: pgina
Source File: CyclicBufferTest.cs
View license
[Test] public void TestSize1()
		{
			CyclicBuffer cb = new CyclicBuffer(1);

			Assert.AreEqual(0, cb.Length, "Empty Buffer should have length 0");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should have max size 1");

			LoggingEvent event1 = new LoggingEvent(null, null, null, null, null, null);
			LoggingEvent event2 = new LoggingEvent(null, null, null, null, null, null);

			LoggingEvent discardedEvent = cb.Append(event1);

			Assert.IsNull(discardedEvent, "No event should be discarded untill the buffer is full");
			Assert.AreEqual(1, cb.Length, "Buffer should have length 1");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should still have max size 1");


			discardedEvent = cb.Append(event2);

			Assert.AreSame(event1, discardedEvent, "Expect event1 to now be discarded");
			Assert.AreEqual(1, cb.Length, "Buffer should still have length 1");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should really still have max size 1");

			LoggingEvent[] discardedEvents = cb.PopAll();

			Assert.AreEqual(1, discardedEvents.Length, "Poped events length should be 1");
			Assert.AreSame(event2, discardedEvents[0], "Expect event2 to now be popped");
			Assert.AreEqual(0, cb.Length, "Buffer should be back to length 0");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should really really still have max size 1");
		}

36. Example

Project: logging-log4net
Source File: CyclicBufferTest.cs
View license
[Test]
		public void TestSize1()
		{
			CyclicBuffer cb = new CyclicBuffer(1);

			Assert.AreEqual(0, cb.Length, "Empty Buffer should have length 0");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should have max size 1");

			LoggingEvent event1 = new LoggingEvent(null, null, null, null, null, null);
			LoggingEvent event2 = new LoggingEvent(null, null, null, null, null, null);

			LoggingEvent discardedEvent = cb.Append(event1);

			Assert.IsNull(discardedEvent, "No event should be discarded untill the buffer is full");
			Assert.AreEqual(1, cb.Length, "Buffer should have length 1");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should still have max size 1");


			discardedEvent = cb.Append(event2);

			Assert.AreSame(event1, discardedEvent, "Expect event1 to now be discarded");
			Assert.AreEqual(1, cb.Length, "Buffer should still have length 1");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should really still have max size 1");

			LoggingEvent[] discardedEvents = cb.PopAll();

			Assert.AreEqual(1, discardedEvents.Length, "Poped events length should be 1");
			Assert.AreSame(event2, discardedEvents[0], "Expect event2 to now be popped");
			Assert.AreEqual(0, cb.Length, "Buffer should be back to length 0");
			Assert.AreEqual(1, cb.MaxSize, "Buffer should really really still have max size 1");
		}

37. Example

Project: NClass
Source File: CyclicBufferTest.cs
View license
[Test]
		public void TestSize2()
		{
			CyclicBuffer cb = new CyclicBuffer(2);

			Assert.AreEqual(0, cb.Length, "Empty Buffer should have length 0");
			Assert.AreEqual(2, cb.MaxSize, "Buffer should have max size 2");

			LoggingEvent event1 = new LoggingEvent(null, null, null, null, null, null);
			LoggingEvent event2 = new LoggingEvent(null, null, null, null, null, null);
			LoggingEvent event3 = new LoggingEvent(null, null, null, null, null, null);

			LoggingEvent discardedEvent;

			discardedEvent = cb.Append(event1);
			Assert.IsNull(discardedEvent, "No event should be discarded after append 1");
			discardedEvent = cb.Append(event2);
			Assert.IsNull(discardedEvent, "No event should be discarded after append 2");

			discardedEvent = cb.Append(event3);
			Assert.AreSame(event1, discardedEvent, "Expect event1 to now be discarded");

			discardedEvent = cb.PopOldest();
			Assert.AreSame(event2, discardedEvent, "Expect event2 to now be discarded");

			LoggingEvent[] discardedEvents = cb.PopAll();

			Assert.AreEqual(1, discardedEvents.Length, "Poped events length should be 1");
			Assert.AreSame(event3, discardedEvents[0], "Expect event3 to now be popped");
			Assert.AreEqual(0, cb.Length, "Buffer should be back to length 0");
			Assert.AreEqual(2, cb.MaxSize, "Buffer should really really still have max size 2");
		}

38. Example

Project: logging-log4net
Source File: CyclicBufferTest.cs
View license
[Test]
		public void TestSize2()
		{
			CyclicBuffer cb = new CyclicBuffer(2);

			Assert.AreEqual(0, cb.Length, "Empty Buffer should have length 0");
			Assert.AreEqual(2, cb.MaxSize, "Buffer should have max size 2");

			LoggingEvent event1 = new LoggingEvent(null, null, null, null, null, null);
			LoggingEvent event2 = new LoggingEvent(null, null, null, null, null, null);
			LoggingEvent event3 = new LoggingEvent(null, null, null, null, null, null);

			LoggingEvent discardedEvent;

			discardedEvent = cb.Append(event1);
			Assert.IsNull(discardedEvent, "No event should be discarded after append 1");
			discardedEvent = cb.Append(event2);
			Assert.IsNull(discardedEvent, "No event should be discarded after append 2");

			discardedEvent = cb.Append(event3);
			Assert.AreSame(event1, discardedEvent, "Expect event1 to now be discarded");

			discardedEvent = cb.PopOldest();
			Assert.AreSame(event2, discardedEvent, "Expect event2 to now be discarded");

			LoggingEvent[] discardedEvents = cb.PopAll();

			Assert.AreEqual(1, discardedEvents.Length, "Poped events length should be 1");
			Assert.AreSame(event3, discardedEvents[0], "Expect event3 to now be popped");
			Assert.AreEqual(0, cb.Length, "Buffer should be back to length 0");
			Assert.AreEqual(2, cb.MaxSize, "Buffer should really really still have max size 2");
		}

39. Example

Project: memcache-driver
Source File: GetRequestTests.cs
View license
[Test]
        public void RedundantGetRequestTest()
        {
            byte[] message = null;
  /n ..... /n //View Source file for more details /n }

40. Example

Project: pgina
Source File: CyclicBufferTest.cs
View license
[Test] public void TestSize2()
		{
			CyclicBuffer cb = new CyclicBuffer(2);

			Assert.AreEqual(0, cb.Length, "Empty Buffer should have length 0");
			Assert.AreEqual(2, cb.MaxSize, "Buffer should have max size 2");

			LoggingEvent event1 = new LoggingEvent(null, null, null, null, null, null);
			LoggingEvent event2 = new LoggingEvent(null, null, null, null, null, null);
			LoggingEvent event3 = new LoggingEvent(null, null, null, null, null, null);

			LoggingEvent discardedEvent = null;
			
			discardedEvent = cb.Append(event1);
			Assert.IsNull(discardedEvent, "No event should be discarded after append 1");
			discardedEvent = cb.Append(event2);
			Assert.IsNull(discardedEvent, "No event should be discarded after append 2");

			discardedEvent = cb.Append(event3);
			Assert.AreSame(event1, discardedEvent, "Expect event1 to now be discarded");

			discardedEvent = cb.PopOldest();
			Assert.AreSame(event2, discardedEvent, "Expect event2 to now be discarded");

			LoggingEvent[] discardedEvents = cb.PopAll();

			Assert.AreEqual(1, discardedEvents.Length, "Poped events length should be 1");
			Assert.AreSame(event3, discardedEvents[0], "Expect event3 to now be popped");
			Assert.AreEqual(0, cb.Length, "Buffer should be back to length 0");
			Assert.AreEqual(2, cb.MaxSize, "Buffer should really really still have max size 2");
		}

41. Example

View license
[Test]
        public void ContainerMustReturnServiceInstance()
        {
            var mockFactory = new Mock<IFactory>();
            var container = new ServiceContainer();

            Type serviceType = typeof (ISerializable);
            var instance = new object();

            container.AddFactory(serviceType, mockFactory.Object);

            // The container must call the IFactory.CreateInstance method
            mockFactory.Expect(
                f => f.CreateInstance(It.Is<IFactoryRequest>(request => request.ServiceType == serviceType
                                                                        && request.Container == container))).Returns(
                                                                            instance);

            object result = container.GetService(serviceType);
            Assert.IsNotNull(result, "The container failed to return the given service instance");
            Assert.AreSame(instance, result, "The service instance returned does not match the given instance");

            mockFactory.VerifyAll();
        }

42. Example

View license
[Test]
		public void SecondLevelCachedCollectionsFiltering()
		{
			TestData testData = new TestData/n ..... /n //View Source file for more details /n }

43. Example

View license
[Test]
		public async Task SecondLevelCachedCollectionsFilteringAsync()
		{
			TestData testData = n/n ..... /n //View Source file for more details /n }