コード例 #1
0
        public void WhenGettingWitDataStorehNullShouldThrowTest()
        {
            // arrange
            StorageProviderFactory.Register(StorageProvider.kWhStorage, typeof(kWhStorage), true);

            // act & assert
            Assert.Throws <ArgumentNullException>(
                () => StorageProviderFactory.GetStorageProvider(false, StorageProvider.kWhStorage, "00-00-000-000", null, 0, Precision.kWh));
        }
コード例 #2
0
        public void WhenRegisteringStorageProviderItShouldReturnTheInstanceOnGetProviderTest()
        {
            // arrange
            StorageProviderFactory.Register(StorageProvider.kWhStorage, typeof(kWhStorage), true);

            // act
            var storage = StorageProviderFactory.GetStorageProvider(false, StorageProvider.kWhStorage, "00-00-000-000", @".\Temp", 1, Precision.mWh);

            // assert
            Assert.IsNotNull(storage);
        }
コード例 #3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory logFactory)
        {
            QboxNextLogProvider.LoggerFactory = logFactory;

            StorageProviderFactory.Register(StorageProvider.kWhStorage, typeof(kWhStorage));

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseMvc();
        }
コード例 #4
0
 public void WhenRegisteringInCorrectTypeItShouldThrowTest()
 {
     Assert.Throws <StorageException>(
         () => StorageProviderFactory.Register(StorageProvider.kWhStorage, typeof(int), true));
 }