public BillingCompany GetNewBillingCompany(BillingCompanyName billingCompanyName,BillingCompanyType billingCompanyType,BillingCompanyScrapingUrl billingCompanyScrapingUrl) { Guard.That(billingCompanyName).IsNotNull(); Guard.That(billingCompanyType).IsNotNull(); Guard.That(billingCompanyScrapingUrl).IsNotNull(); return new BillingCompany(eventAggregator, billingCompanyName, billingCompanyType, billingCompanyScrapingUrl); }
public void GivenUnmakeableUrl_WhenConstructingABillingCompanyUrl_ExceptionIsThrown() { //arrange url = "s.com"; //act var billingCompanyUrl = new BillingCompanyScrapingUrl(url); //assert //exception attribute }
public void GivenAvalidUrl_WhenConstructingABillingCompanyUrl_NoExceptionIsThrown() { //arrange url = "https://www.google.com"; //act var billingCompanyUrl = new BillingCompanyScrapingUrl(url); //assert Assert.IsTrue(billingCompanyUrl.ToString() == "https://www.google.com"); }
public void GivenAUrlWithHttpAndNotHttps_WhenConstructingABillingCompanyUrl_ExceptionIsThrown() { //arrange url = "http://www.google.com"; //act var billingCompanyUrl = new BillingCompanyScrapingUrl(url); //assert //exception attribute }
public void GivenAnEmptyString_WhenConstructingABillingCompanyUrl_ExceptionIsThrown() { //arrange url = ""; //act var billingCompanyUrl = new BillingCompanyScrapingUrl(url); //assert //exception attribute }
public BillingCompany(IEventAggregator eventAggregator, BillingCompanyName companyName, BillingCompanyType companyType, BillingCompanyScrapingUrl companyScrapingUrl) { this.billingCompanyName = companyName; this.billingCompanyType = companyType; this.billingCompanyScrapingUrl = companyScrapingUrl; this.eventAggregator = eventAggregator; this.eventAggregator.Subscribe(this); this.openClosedWindows = new List<OpenClosedWindow>(); this.scrapingErrorRetryConfigurations = new List<ScrapingErrorRetryConfiguration>(); }
public void GivenABillingCompanyUrl_SettingItsValue_ChangesItsIntance() { //arrange url = "https://www.google.com"; var billingCompanyUrl = new BillingCompanyScrapingUrl(url); //act var billingCompanyUrl2 = billingCompanyUrl.ChangeUrl("https://www.google.com"); //assert Assert.IsTrue(billingCompanyUrl2 != billingCompanyUrl); }
public void Setup() { companyName = new BillingCompanyName("Company A"); companyType = new BillingCompanyType(1); companyUrl = new BillingCompanyScrapingUrl("https://www.google.com/"); //arrange var builder = new ContainerBuilder(); builder.RegisterType<EventAggregator>().As<IEventAggregator>(); builder.RegisterType<BillingCompanyRepositoryFake>().As<BillingCompanyRepositoryFake>(); container = builder.Build(); }
public void WhenConstructingANewBillingCompanyTheUrlShouldNotNull() { // arrange ( repository and depenency injection done ) companyUrl = null; // act BillingCompany billingCompany = container.Resolve<BillingCompanyRepositoryFake>(). GetNewBillingCompany(companyName, companyType, companyUrl); // assert // expected exception }
public void SetBillingCompanyUrl(BillingCompanyScrapingUrl scrapingUrl) { // validation of action this.billingCompanyScrapingUrl = scrapingUrl; }