public void Inserted_Expected_Links() { var ad = AdvertisementFactory.GetAdverstisementType1(); Assert.Equal(1, _context.FlatOffers .Where(x => x.Links.Any(y => y.Url.Equals(ad.Url) && y.UniqueId == ad.UniqueId)) .Count()); }
public void Inserted_Single_Image() { var ad = AdvertisementFactory.GetAdverstisementType1(); Assert.Equal(1, _context.FlatOffers .SelectMany(x => x.Images) .Count() ); }
public void Inserted_Add_Notification() { var ad = AdvertisementFactory.GetAdverstisementType1(); Assert.Equal(1, _context.FlatOffers .SelectMany(x => x.Notifications) .Where(x => x.Type == Entities.NotificationType.OfferAdded) .Count() ); }
public void Inserted_FlatOffer_Has_Expected_Values() { var ad = AdvertisementFactory.GetAdverstisementType1(); Assert.Equal(1, _context.FlatOffers.Where(x => x.Address.Equals(ad.Address) && x.FlatSize == ad.FlatSize && x.FlatType == ad.FlatType && x.NumberOfRooms == ad.NumberOfRooms && x.Price == ad.Price && x.Removed == false) .Count()); }
public RemoveAndAddFlatOfferTestFixture(FlatOffersDbContextFixture dbFixture) { var connectionString = dbFixture.Context.Database.GetDbConnection().ConnectionString; var checkpoint = new Checkpoint(); Task.Run(() => checkpoint.Reset(connectionString)).Wait(); var Offer = FlatOfferFactory.GetFlatOfferType1(); var Ad2 = AdvertisementFactory.GetAdverstisementType1(); PopulateTables(dbFixture, Offer); var collector = new TestCollectorStub(); collector.Add(Ad2); var underTest = TrackOfferHandlerFactory.GetInstance(dbFixture.Context, collector); underTest.Execute(); }