public void TestFixtureSetUp() { loggerMock = new MockLogger(); fileSystemMock = new Mock <IFileSystem>(); serializeWrapperMock = new Mock <ISerializeWrapper>(); // ISystemIOWrapper.File.ReadAllText Method Mocks fileSystemMock.Setup(f => f.File.ReadAllText(expectedAWDataSourceFileName)) .Returns(() => expectedAWDataSource); fileSystemMock.Setup(f => f.File.ReadAllText(expectedAWDataSource_DeserializeException_FileName)) .Returns(() => expectedAWDataSource_DeserializeException); // ISystemIOWrapper.File.Exists Method Mocks fileSystemMock.Setup(f => f.File.Exists(expectedAWDataSourceFileName)) .Returns(() => true); fileSystemMock.Setup(f => f.File.Exists(expectedAWDataSource_DeserializeException_FileName)) .Returns(() => true); fileSystemMock.Setup(f => f.File.Exists(expectedDataSourceItem_NotFound_Filename)) .Returns(() => false); // ISystemIOWrapper.Path.GetDirectoryName Method Mocks fileSystemMock.Setup(f => f.Path.GetDirectoryName(expectedAWDataSourceFileName)) .Returns(() => expectedAWDataSourcePath); fileSystemMock.Setup(f => f.Path.GetDirectoryName(expectedAWDataSource_DeserializeException_FileName)) .Returns(() => expectedAWDataSourcePath_DeserializeException); // ISerializeWrapper.DeserializeObject<DataSourceItem> Method Mocks serializeWrapperMock.Setup(s => s.DeserializeObject <DataSourceItem>(expectedAWDataSource)) .Returns(() => expectedAWDataSourceItem); serializeWrapperMock.Setup( s => s.DeserializeObject <DataSourceItem>(expectedAWDataSource_DeserializeException)) .Throws( new JsonSerializationException( "Unexpected end when deserializing object. Path 'Password', line 10, position 20.")); importer = new DataSourceItemImporter(serializeWrapperMock.Object, fileSystemMock.Object, loggerMock); }
public void TestFixtureSetUp() { loggerMock = new MockLogger(); fileSystemMock = new Mock<IFileSystem>(); serializeWrapperMock = new Mock<ISerializeWrapper>(); // ISystemIOWrapper.File.ReadAllText Method Mocks fileSystemMock.Setup(f => f.File.ReadAllText(expectedAWDataSourceFileName)) .Returns(() => expectedAWDataSource); fileSystemMock.Setup(f => f.File.ReadAllText(expectedAWDataSource_DeserializeException_FileName)) .Returns(() => expectedAWDataSource_DeserializeException); // ISystemIOWrapper.File.Exists Method Mocks fileSystemMock.Setup(f => f.File.Exists(expectedAWDataSourceFileName)) .Returns(() => true); fileSystemMock.Setup(f => f.File.Exists(expectedAWDataSource_DeserializeException_FileName)) .Returns(() => true); fileSystemMock.Setup(f => f.File.Exists(expectedDataSourceItem_NotFound_Filename)) .Returns(() => false); // ISystemIOWrapper.Path.GetDirectoryName Method Mocks fileSystemMock.Setup(f => f.Path.GetDirectoryName(expectedAWDataSourceFileName)) .Returns(() => expectedAWDataSourcePath); fileSystemMock.Setup(f => f.Path.GetDirectoryName(expectedAWDataSource_DeserializeException_FileName)) .Returns(() => expectedAWDataSourcePath_DeserializeException); // ISerializeWrapper.DeserializeObject<DataSourceItem> Method Mocks serializeWrapperMock.Setup(s => s.DeserializeObject<DataSourceItem>(expectedAWDataSource)) .Returns(() => expectedAWDataSourceItem); serializeWrapperMock.Setup( s => s.DeserializeObject<DataSourceItem>(expectedAWDataSource_DeserializeException)) .Throws( new JsonSerializationException( "Unexpected end when deserializing object. Path 'Password', line 10, position 20.")); importer = new DataSourceItemImporter(serializeWrapperMock.Object, fileSystemMock.Object, loggerMock); }
public void TestFixtureSetUp() { importer = TestKernel.Instance.Get <DataSourceItemImporter>(); }
public void TestFixtureSetUp() { importer = TestKernel.Instance.Get<DataSourceItemImporter>(); }