public FileCabinetFacts() { this.config = new TestProviderConfiguration(); this.mockStorageProvider = new Mock<IStorageProvider<TestProviderConfiguration>>(); this.mockStorageProvider.SetupGet(p => p.ProviderType).Returns(TestProviderType); this.fileCabinet = new FileCabinet<TestProviderConfiguration>(mockStorageProvider.Object, config); }
public FileCabinetFacts() { this.config = new TestProviderConfiguration(); this.mockStorageProvider = new Mock <IStorageProvider <TestProviderConfiguration> >(); this.mockStorageProvider.SetupGet(p => p.ProviderType).Returns(TestProviderType); this.fileCabinet = new FileCabinet <TestProviderConfiguration>(mockStorageProvider.Object, config); }
public void Register_And_Get_Provider() { var mockProvider = new Mock<IStorageProvider<TestProviderConfiguration>>(); cabinetFactory.RegisterProvider(mockProvider.Object); var providerConfig = new TestProviderConfiguration(); var cabinet = cabinetFactory.GetCabinet(providerConfig); Assert.NotNull(cabinet); }
public void Register_And_Get_Provider() { var mockProvider = new Mock <IStorageProvider <TestProviderConfiguration> >(); cabinetFactory.RegisterProvider(mockProvider.Object); var providerConfig = new TestProviderConfiguration(); var cabinet = cabinetFactory.GetCabinet(providerConfig); Assert.NotNull(cabinet); }
public void Get_Provider_Throws_Null_Config() { TestProviderConfiguration config = null; Assert.Throws <ArgumentNullException>(() => cabinetFactory.GetCabinet(config)); }