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 WhenConstructingANewBillingCompanyTheCompanyTypeShouldNotNull()
        {
            // arrange ( repository and depenency injection done )
            companyType = null;

            // act
            BillingCompany billingCompany = container.Resolve<BillingCompanyRepositoryFake>().
                GetNewBillingCompany(companyName, companyType, companyUrl);

            // assert
            // expected exception
        }
Beispiel #3
0
        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 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();
        }
Beispiel #5
0
        public void SetBillingCompanyType(BillingCompanyType companyType)
        {
            // validation of action

            this.billingCompanyType = companyType;
        }