public void Content() { Mock<IPrintContent>[] m1 = { new Mock<IPrintContent>(), new Mock<IPrintContent>(), new Mock<IPrintContent>(), new Mock<IPrintContent>() }; foreach (var mock in m1) { mock.SetupGet(i => i.Content).Returns(new UIElement()); } CombinedPrintContentCollection collection = new CombinedPrintContentCollection(m1.Select(i => i.Object).ToArray()); Assert.That(collection.Content, Is.Not.Null); CollectionAssert.AreEqual(m1.Select(i => i.Object), collection); foreach (var mock in m1) { mock.VerifyAll(); } }
public void Content() { Mock <IPrintContent>[] m1 = { new Mock <IPrintContent>(), new Mock <IPrintContent>(), new Mock <IPrintContent>(), new Mock <IPrintContent>() }; foreach (var mock in m1) { mock.SetupGet(i => i.Content).Returns(new UIElement()); } CombinedPrintContentCollection collection = new CombinedPrintContentCollection(m1.Select(i => i.Object).ToArray()); Assert.That(collection.Content, Is.Not.Null); CollectionAssert.AreEqual(m1.Select(i => i.Object), collection); foreach (var mock in m1) { mock.VerifyAll(); } }