public void TestResolveAllTwoElements() { var container = this.GetContainer(); var first = new ParentMock(); container.Register(first); var second = new ChildMock(); container.Register(second, second.GetType()); var resolved = container.GetAll().OfType <ParentMock>().ToList(); resolved.Should().NotBeNull("resolved collection should not be null"); resolved.Count.Should().Be(2, "resolved collection should have 2 elements"); resolved.First().Should().BeSameAs(first, "resolved element 1 should be the original item"); resolved.Last().Should().BeSameAs(second, "resolved element 2 should be the new item"); }
public void TestResolveAllTwoElements() { var container = this.GetContainer(); var first = new ParentMock(); container.Register(first); var second = new ChildMock(); container.Register(second, second.GetType()); var resolved = container.GetAll().OfType<ParentMock>().ToList(); resolved.Should().NotBeNull("resolved collection should not be null"); resolved.Count.Should().Be(2, "resolved collection should have 2 elements"); resolved.First().Should().BeSameAs(first, "resolved element 1 should be the original item"); resolved.Last().Should().BeSameAs(second, "resolved element 2 should be the new item"); }