public void test_publish_a_valid_ad_should_be_success() { //Given _classifiedAd.SetTitle(ClassifiedAdTitle.FromString("covid-19 comming")); _classifiedAd.UpdateText(ClassifiedAdText.FromString("keeping social distancing")); _classifiedAd.UpdatePrice(Price.Create(100M, Currency.Default)); _classifiedAd.AddPicture(new Uri("http://localhost/storage/123.jpg"), new PictureSize(800, 600)); //When _classifiedAd.RequestToPublish(); //Then Assert.Equal(ClassifiedAdState.PendingReview, _classifiedAd.State); }
public void Can_publish_a_valid_ad() { _classifiedAd.SetTitle(ClassifiedAdTitle.FromString("Test ad")); _classifiedAd.UpdateText(ClassifiedAdText.FromString("Please buy my stuff")); _classifiedAd.UpdatePrice(Price.FromDecimal(100.10m, "EUR", new FakeCurrencyLookup())); _classifiedAd.AddPicture(new Uri("http://www.google.de"), new PictureSize(1000, 1000)); _classifiedAd.RequestToPublish(); Assert.Equal(ClassifiedAd.ClassifiedAdState.PendingReview, _classifiedAd.State); }
public void Request_publishing_should_succeed_when_ad_is_complete() { var ad = new ClassifiedAd(new ClassifiedAdId(Guid.NewGuid()), new UserId(Guid.NewGuid())); ad.AddPicture(new PictureId(Guid.NewGuid()), new PictureSize(800, 600), new Uri("http://example.com")); ad.SetTitle(ClassifiedAdTitle.FromTextOrHtml("Fine car!")); ad.UpdateText(ClassifiedAdText.FromString("1981 Talbot. Mint condition, no rust")); ad.UpdatePrice(Price.FromDecimal(1500m, "EUR", new FakeCurrencyLookup())); ad.RequestToPublish(); Assert.Equal(ClassifiedAdState.PendingReview, ad.State); }