public void Test() { var mock = new Mock <ITest>(); ITest instance; Assert.DoesNotThrow(() => instance = mock.Object); }
public void ByteArrayCallbackArgumentShouldNotBeNull() { var data = new byte[] { 2, 1, 2 }; var stream = new Mock <Stream>(); stream.SetupGet(m => m.Length) .Returns(data.Length); stream.Setup(m => m.Read(It.IsAny <byte[]>(), It.IsAny <int>(), It.IsAny <int>())) .Callback <byte[], int, int>((b, o, c) => data.CopyTo(b, 0)) .Returns(data.Length); var contents = new byte[stream.Object.Length]; Assert.DoesNotThrow(() => stream.Object.Read(contents, 0, (int)stream.Object.Length)); }
public void Test() { Assert.DoesNotThrow(() => new Mock <IFoo>().SetupAllProperties()); }