public void NewEmail()
        {
            //MasterConfiguration.MConfiguration.SetConfigurationName("ConfigurationTest.config");

            var builder = new ContainerBuilder();

            //builder.RegisterModule<CalculateEmails.Service.Autofac>();
            //builder.RegisterModule<CalculateEmails.ServiceClient.AutofacModule>();
            builder.RegisterType <StatsClient>().As <IStatsClient>();
            builder.RegisterType <DateTimePT.DateTimeTools>().As <DateTimePT.IDateTimeTools>();
            builder.RegisterModule <CalculateEmails.Service.Autofac>();
            builder.RegisterType <Configuration>().As <IConfig>();

            AutofacContainer.Container = builder.Build();

            PSCalculateEmails calculateEmails = new PSCalculateEmails();

            calculateEmails.OnTest();

            ProcessingClient client = new ProcessingClient();

            client.ProcessOutlookMail(CalculateEmails.Contract.DataContract.InboxType.Main, CalculateEmails.Contract.DataContract.EmailActionType.Added);

            StatsClient onlineClient = new StatsClient();
            var         stats        = onlineClient.GetCalculationDay();

            Assert.AreEqual(1, stats.MailCountAdd);
        }
Beispiel #2
0
 private CalculationDay GetCalculationDayDetails()
 {
     if (ServiceIsWorking)
     {
         StatsClient onlineClient = new StatsClient();
         CalculationDay calculationDay = onlineClient.GetCalculationDay();
         return calculationDay;
     }
     else
     {
         return new CalculationDay();
     }
 }