private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Initer.Init(); Application.Run(new AtmForm()); }
protected void Application_Start() { InitContainer(); InitWebApi(); Initer.Init(ConnectionString); }
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(); }
public Startup(IConfiguration configuration) { Configuration = configuration; var connectionString = Configuration.GetConnectionString("CustomerManagementDatabase"); Initer.Init(connectionString); }
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); }
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"); }
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); }
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); }
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); }
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); }
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(); }
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); }
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); }
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); } }
public App() { Initer.Init(@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=SnackMachine;Integrated Security=True"); }
public App() { Initer.Init("Server=(localdb)\\mssqllocaldb;Database=DddInPractice;Trusted_Connection=True;"); }
public App() { Initer.Init(ConfigurationManager.ConnectionStrings["SnackMachine"].ConnectionString); }
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"); }
protected Tests() { ClearDatabase(); Initer.Init(ConnectionString); }
// implement sessions closest to the startup public App() { Initer.Init(@"Server=.;Database=DddInPractice;Trusted_Connection=true"); // better way get it from config file }
public App() { Initer.Init("Server=DESKTOP-H9JQ47G;Database=Micromania;Trusted_Connection=True;"); }
public App() { Initer.Init(@"Server=.\SQLEXPRESS;Database=DddInPractice;Trusted_Connection=true"); }
public App() { Initer.Init(@"Server=(LocalDb)\MSSQLLocalDB;Database=SpecPattern;Trusted_Connection=true;"); }
public App() { Initer.Init(); }
protected void Application_Start() { GlobalConfiguration.Configure(WebApiConfig.Register); Initer.Init(ConfigurationManager.ConnectionStrings["EventStore"].ConnectionString); }
public App() { Initer.Init(@"Server=(localdb)\MSSQLLocalDB;Database=DddInPractice;Trusted_Connection=True"); }
public App() { Initer.Init(@"Server=.\Sql;Database=SpecPattern;Trusted_Connection=true;"); }