Ejemplo n.º 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);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 4
0
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;

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

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

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

            ClearDatabase(conn);
            Initer.Init(conn);
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 17
0
 public App()
 {
     Initer.Init(@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=SnackMachine;Integrated Security=True");
 }
Ejemplo n.º 18
0
 public App()
 {
     Initer.Init("Server=(localdb)\\mssqllocaldb;Database=DddInPractice;Trusted_Connection=True;");
 }
Ejemplo n.º 19
0
 public App()
 {
     Initer.Init(ConfigurationManager.ConnectionStrings["SnackMachine"].ConnectionString);
 }
Ejemplo n.º 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");
 }
Ejemplo n.º 21
0
        protected Tests()
        {
            ClearDatabase();

            Initer.Init(ConnectionString);
        }
Ejemplo n.º 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
        }
Ejemplo n.º 23
0
 public App()
 {
     Initer.Init("Server=DESKTOP-H9JQ47G;Database=Micromania;Trusted_Connection=True;");
 }
Ejemplo n.º 24
0
 public App()
 {
     Initer.Init(@"Server=.\SQLEXPRESS;Database=DddInPractice;Trusted_Connection=true");
 }
Ejemplo n.º 25
0
 public App()
 {
     Initer.Init(@"Server=(LocalDb)\MSSQLLocalDB;Database=SpecPattern;Trusted_Connection=true;");
 }
Ejemplo n.º 26
0
 public App()
 {
     Initer.Init();
 }
Ejemplo n.º 27
0
 protected void Application_Start()
 {
     GlobalConfiguration.Configure(WebApiConfig.Register);
     Initer.Init(ConfigurationManager.ConnectionStrings["EventStore"].ConnectionString);
 }
Ejemplo n.º 28
0
 public App()
 {
     Initer.Init(@"Server=(localdb)\MSSQLLocalDB;Database=DddInPractice;Trusted_Connection=True");
 }
Ejemplo n.º 29
0
 public App()
 {
     Initer.Init(@"Server=.\Sql;Database=SpecPattern;Trusted_Connection=true;");
 }