Пример #1
0
        public void HotelCSVDataFeed_can_dettach_the_SmartTravel_with_Id_specified(int id)
        {
            // Arrange
            var notifier          = MockRepository.GenerateMock <INotifier>();
            var csvDataFeed       = new HotelCSVDataFeed(notifier);
            var affiliateDetached = new SmartTravel {
                Id = id
            };
            var affiliates = new List <IAffiliate>
            {
                new SmartTravel {
                    Id = 7
                },
                new SmartTravel {
                    Id = 38
                },
                new SmartTravel {
                    Id = 102
                }
            };

            csvDataFeed.Affiliates = affiliates;

            // Act
            csvDataFeed.Detach(affiliateDetached);
            var affiliatesActual = csvDataFeed.Affiliates;

            // Assert
            affiliatesActual.Should().OnlyContain(a => a.Id != affiliateDetached.Id);
        }
Пример #2
0
        public void HotelCSVDataFeed_can_attach_a_SmartTravel_with_Id_and_Name_specified(int id, string name)
        {
            // Arrange
            var notifier          = MockRepository.GenerateMock <INotifier>();
            var affiliateAttached = new SmartTravel {
                Id = id, Name = name
            };
            var csvDataFeed = new HotelCSVDataFeed(notifier);

            // Act
            csvDataFeed.Attach(affiliateAttached);
            var affiliatesActual = csvDataFeed.Affiliates;

            // Assert
            affiliatesActual.Should().ContainSingle(a => a.Id == affiliateAttached.Id && a.Name == name);
        }