public void BuildShouldThrowExceptionIfOptionsAreNotSet() { // Assert var apartmentAdFactory = new ApartmentAdFactory(); // Act Action act = () => apartmentAdFactory .WithNeighborhood("TestNeighborhood") .WithCategory("TestCategory", "TestDescription") .Build(); // Assert act.Should().Throw <InvalidApartmentAdException>(); }
public void BuildShouldThrowExceptionIfCategoryIsNotSet() { // Assert var apartmentAdFactory = new ApartmentAdFactory(); // Act Action act = () => apartmentAdFactory .WithNeighborhood("TestNeighborhood") .WithOptions(true, true, HeatingType.Еlectricity) .Build(); // Assert act.Should().Throw <InvalidApartmentAdException>(); }
public void BuildShouldCreateApartmentAdIfEveryPropertyIsSet() { // Assert var apartmentAdFactory = new ApartmentAdFactory(); // Act var apartmentAd = apartmentAdFactory .WithNeighborhood("TestNeighborhood") .WithCategory(CategoryFakes.ValidCategoryName, "TestCategoryDescription") .WithOptions(true, true, HeatingType.Еlectricity) .WithImageUrl("http://test.image.url") .WithFloor(10) .WithPricePerMonth(1000) .Build(); // Assert apartmentAd.Should().NotBeNull(); }