Пример #1
0
 private static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Initer.Init();
     Application.Run(new AtmForm());
 }
        protected void Application_Start()
        {
            InitContainer();
            InitWebApi();

            Initer.Init(ConnectionString);
        }
Пример #3
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Clearing database...");
            ClearDatabases();
            Initer.Init(SqlServerConnectionString, MongoConnectionString);
            Console.WriteLine("Completed");

            Console.WriteLine("Creating nodes...");
            CreateNodes();
            Console.WriteLine("Completed");

            Console.WriteLine("Linking nodes...");
            long milliseconds1 = LinkSqlNodes();

            Console.WriteLine("SQL : " + milliseconds1);
            long milliseconds2 = LinkMongoNodes();

            Console.WriteLine("Mongo : " + milliseconds2);
            Console.WriteLine("Completed");

            Console.WriteLine("Fetching nodes...");
            long milliseconds3 = FetchSqlNodes();

            Console.WriteLine("SQL : " + milliseconds3);
            long milliseconds4 = FetchMongoNodes();

            Console.WriteLine("Mongo : " + milliseconds4);
            Console.WriteLine("Completed");

            Console.ReadKey();
        }
Пример #4
0
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;

            var connectionString = Configuration.GetConnectionString("CustomerManagementDatabase");

            Initer.Init(connectionString);
        }
Пример #5
0
 public App()
 {
     Initer.Init();
     //using (ISession session = SessionFactory.OpenSession())
     //{
     //    long id = 1;
     //    var snackMachine = session.Get<SnackMachine>(id);
     //}
 }
        protected TestBase()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.test.json").Build();

            var conn = config.GetConnectionString("CustomerManagementDatabase");

            ClearDatabase(conn);
            Initer.Init(conn);
        }
Пример #7
0
        public void CustomerId10HasNamePietro()
        {
            Initer.Init(@"Server=(local);Database=test;Trusted_Connection=Yes;");

            CustomerRepository customerRepository = new CustomerRepository();

            Customer c = customerRepository.GetById(10);

            c.Name.Should().Be("Pietro");
        }
Пример #8
0
        public void Take_money_raises_an_event()
        {
            Initer.Init(@"Data Source=.\dev;Initial Catalog=SnackMachineDb;Integrated Security=SSPI;");

            var atm = new Atm();

            atm.LoadMoney(Dollar);
            atm.TakeMoney(1m);

            atm.ShouldContainBalanceChangeEvents(1.01m);
        }
        public MainViewModel()
        {
            Initer.Init(@"Server=(localdb)\MSSqlLocalDB;Database=DDDInPractice;Trusted_Connection=true");

            var repository = new SnackMachineRepository();

            var snackMachine = repository.GetById(1L);

            var viewModel = new SnackMachineViewModel(snackMachine);

            _dialogService.ShowDialog(viewModel);
        }
Пример #10
0
        public void NewCustomerPersists()
        {
            Initer.Init(@"Server=(local);Database=test;Trusted_Connection=Yes;"); // comment here
            DomainEvents.Init();
            CustomerRepository customerRepository = new CustomerRepository();
            Customer           c = new Customer("Pietro");

            c.AddCustomerAddedEvent();
            Customer d = new Customer("Paolo");

            customerRepository.Save(d);
        }
Пример #11
0
        public void Commission_is_rounded_up_to_the_next_cent()
        {
            Initer.Init("Server=(localdb)\\mssqllocaldb;Database=DddInPractice;Trusted_Connection=True;");
            BalanceChangedEvent balanceChangedEvent = null;

            DomainEvents_old.Register <BalanceChangedEvent>(ev => balanceChangedEvent = ev);
            var atm = new Atm();

            atm.LoadMoney(Dollar + TenCent);

            atm.TakeMoney(1.1m);

            atm.MoneyCharged.Should().Be(1.12m);
        }
Пример #12
0
        public void Commission_is_at_least_one_cent()
        {
            Initer.Init("Server=(localdb)\\mssqllocaldb;Database=DddInPractice;Trusted_Connection=True;");
            BalanceChangedEvent balanceChangedEvent = null;

            DomainEvents_old.Register <BalanceChangedEvent>(ev => balanceChangedEvent = ev);
            var atm = new Atm();

            atm.LoadMoney(Cent);

            atm.TakeMoney(0.01m);

            atm.MoneyCharged.Should().Be(0.02m);
        }
Пример #13
0
        public static void Main(string[] args)
        {
            var configurationRoot = new ConfigurationBuilder()
                                    .SetBasePath(Directory.GetCurrentDirectory())
                                    .AddJsonFile("appsettings.json")
                                    .Build();

            Initer.Init(configurationRoot.GetConnectionString("DefaultConnectionString"));

            Host
            .CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webHostBuilder => { webHostBuilder.UseStartup <Startup>(); })
            .Build()
            .Run();
        }
Пример #14
0
        public void Take_money_raises_an_event()
        {
            Initer.Init("Server=(localdb)\\mssqllocaldb;Database=DddInPractice;Trusted_Connection=True;");
            Atm atm = new Atm();

            atm.LoadMoney(Dollar);
            BalanceChangedEvent balanceChangedEvent = null;

            DomainEvents_old.Register <BalanceChangedEvent>(ev => balanceChangedEvent = ev);

            atm.TakeMoney(1m);

            balanceChangedEvent.Should().NotBeNull();
            balanceChangedEvent.Delta.Should().Be(1.01m);
        }
Пример #15
0
        public void Take_money_raises_an_event()
        {
            Initer.Init(@"Server=(localdb)\MSSqlLocalDB;Database=DDDInPractice;Trusted_Connection=true");

            var atm = new Atm();

            atm.LoadMoney(Money.Dollar);

            atm.TakeMoney(1m);

            var balanceChangedEvent = atm.DomainEvents[0] as BalanceChangedEvent;

            balanceChangedEvent.Should().NotBeNull();
            balanceChangedEvent.Delta.Should().Be(1.01m);
        }
Пример #16
0
 public App()
 {
     try
     {
         Initer.Init();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         Console.WriteLine(ex.StackTrace);
         // How do I exit a WPF application programmatically?
         // https://stackoverflow.com/questions/2820357/how-do-i-exit-a-wpf-application-programmatically
         Current.Shutdown(-200);
     }
 }
Пример #17
0
 public App()
 {
     Initer.Init(@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=SnackMachine;Integrated Security=True");
 }
Пример #18
0
 public App()
 {
     Initer.Init("Server=(localdb)\\mssqllocaldb;Database=DddInPractice;Trusted_Connection=True;");
 }
Пример #19
0
 public App()
 {
     Initer.Init(ConfigurationManager.ConnectionStrings["SnackMachine"].ConnectionString);
 }
Пример #20
0
 public App()
 {
     Initer.Init(@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=SpecPattern;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False");
 }
Пример #21
0
        protected Tests()
        {
            ClearDatabase();

            Initer.Init(ConnectionString);
        }
Пример #22
0
        // implement sessions closest to the startup

        public App()
        {
            Initer.Init(@"Server=.;Database=DddInPractice;Trusted_Connection=true"); // better way get it from config file
        }
Пример #23
0
 public App()
 {
     Initer.Init("Server=DESKTOP-H9JQ47G;Database=Micromania;Trusted_Connection=True;");
 }
Пример #24
0
 public App()
 {
     Initer.Init(@"Server=.\SQLEXPRESS;Database=DddInPractice;Trusted_Connection=true");
 }
Пример #25
0
 public App()
 {
     Initer.Init(@"Server=(LocalDb)\MSSQLLocalDB;Database=SpecPattern;Trusted_Connection=true;");
 }
Пример #26
0
 public App()
 {
     Initer.Init();
 }
Пример #27
0
 protected void Application_Start()
 {
     GlobalConfiguration.Configure(WebApiConfig.Register);
     Initer.Init(ConfigurationManager.ConnectionStrings["EventStore"].ConnectionString);
 }
Пример #28
0
 public App()
 {
     Initer.Init(@"Server=(localdb)\MSSQLLocalDB;Database=DddInPractice;Trusted_Connection=True");
 }
Пример #29
0
 public App()
 {
     Initer.Init(@"Server=.\Sql;Database=SpecPattern;Trusted_Connection=true;");
 }