Example #1
0
        private void Generate()
        {
            try
            {
                //0. Hide "Save As" button
                ButtonSaveAs_visible(false);

                //1. Gather inputs
                ParseInput(_model);

                //2. Make Progress Bar visible
                ProgressBar_visible(true);

                //3. Generate data sample, update progress bar per sample generated
                _generator.Generate(_model);

                //4. pause
                System.Threading.Thread.Sleep(1000);

                //5. Make Progress Bar invisible
                ProgressBar_visible(false);

                //6. Show "Save As" button
                ButtonSaveAs_visible(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
        public DatabaseFixture()
        {
            AppSettings = new AppSettings()
            {
                Path      = PATH,
                JwtSecret = SECRET
            };
            AppEvents = new AppEvents();

            var datapath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());

            Directory.CreateDirectory(datapath);
            hostingEnvironment = new HostingEnvironment()
            {
                ContentRootFileProvider = new PhysicalFileProvider(datapath)
            };
            HostServiceCollection = new ServiceCollection()
            {
            };

            HostServiceCollection.AddSingleton <IHostingEnvironment>(hostingEnvironment);
            var builder = new OurOrdersBuilder(AppSettings, AppEvents, HostServiceCollection);

            builder
            .UseInMemoryDB();

            ServiceProvider = CreateServiceProvider(builder);

            RandomData = ServiceProvider.GetService <RandomData>();
            AsyncHelper.RunSync(() => RandomData.Generate());
        }
 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
 public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider serviceProvider)
 {
     app
     .UseOurOrders(configureEvents: (appEvents) =>
     {
         appEvents.Configure += (sender, s) =>
         {
             s.AddSingleton <IEmailSender>(emailSender);
             s.AddSingleton <RandomData>();
         };
         appEvents.ApplicationStarted += (sender, s) =>
         {
             RandomData  = s.GetService <RandomData>();
             UserManager = s.GetService <UserManager>();
             AsyncHelper.RunSync(() => RandomData.Generate());
         };
     });
 }
Example #4
0
        public TestServiceFixture()
        {
            AppSettings = new AppSettings()
            {
                Path      = PATH,
                JwtSecret = SECRET
            };
            AppEvents = new AppEvents();

            var datapath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());

            Directory.CreateDirectory(datapath);
            hostingEnvironment = new HostingEnvironment()
            {
                ContentRootFileProvider = new PhysicalFileProvider(datapath)
            };
            HostServiceCollection = new ServiceCollection()
            {
            };

            HostServiceCollection.AddSingleton <IHostingEnvironment>(hostingEnvironment);
            var builder = new OurOrdersBuilder(AppSettings, AppEvents, HostServiceCollection);

            builder
            .UseInMemoryDB();

            ServiceProvider = CreateServiceProvider(builder);

            RandomData = ServiceProvider.GetService <RandomData>();

            AsyncHelper.RunSync(() => RandomData.Generate());

            var testServiceProvider = new InMemoryRepository <TestServiceModel, TestServiceModel>(this.ServiceProvider);

            var type = typeof(TestServiceModel);

            TestService = new TestService(testServiceProvider, this.AppEvents);

            name  = "Name with special cha$@c.\\|/ract<b .>/@#$%^&*()_";
            count = 10;
            names = Enumerable.Range(0, count).Select(i => $"{name} {i}");
        }
Example #5
0
 public virtual byte[] GenerateNonce()
 {
     return(RandomData.Generate(NonceSize));
 }