コード例 #1
0
        public void Add_WhenInfoIsNotNullAndDoesNotExistWithinCollection_AddsInfoToCollection()
        {
            IInfoCollection <ICreditInfo, Sut> sut = CreateSut();

            ICreditInfo creditInfo = _fixture.BuildCreditInfoMock().Object;

            sut.Add(creditInfo);

            Assert.That(sut.Contains(creditInfo), Is.True);
        }
コード例 #2
0
        public void Add_WhenInfoCollectionIsNotNullAndEachInfoDoesNotExistWithinCollection_AddsEachInfoToCollection()
        {
            IInfoCollection <ICreditInfo, Sut> sut = CreateSut();

            IEnumerable <ICreditInfo> infoCollection = new List <ICreditInfo>
            {
                _fixture.BuildCreditInfoMock().Object,
                                      _fixture.BuildCreditInfoMock().Object,
                                      _fixture.BuildCreditInfoMock().Object,
                                      _fixture.BuildCreditInfoMock().Object,
                                      _fixture.BuildCreditInfoMock().Object,
                                      _fixture.BuildCreditInfoMock().Object,
                                      _fixture.BuildCreditInfoMock().Object
            };

            sut.Add(infoCollection);

            Assert.That(infoCollection.All(info => sut.Contains(info)), Is.True);
        }