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)); }
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); }
// 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(); }
public void WhenRegisteringInCorrectTypeItShouldThrowTest() { Assert.Throws <StorageException>( () => StorageProviderFactory.Register(StorageProvider.kWhStorage, typeof(int), true)); }