public void InitializeTest() { EducationContext = new EducationDataContext(); Container = AssemblySetup.CreateWindsorContainer(EducationContext); RepositoryContainer repositoryContainer = new RepositoryContainer(Container, EducationContext); Target = new PrivateHealthFieldManager(repositoryContainer, MockRepository.GenerateMock<IBlobClient>(), new DataTableBinder(), new UserAuditor()); }
public void InitializeTest() { EducationContext = new EducationDataContext(); Container = AssemblySetup.CreateWindsorContainer(EducationContext); RepositoryContainer repositoryContainer = new RepositoryContainer(Container, EducationContext); Target = new PrivateHealthFieldManager(repositoryContainer, MockRepository.GenerateMock <IBlobClient>(), new DataTableBinder(), new UserAuditor()); }
public void InitializeTest() { IBlobClient mockBlobClient = MockRepository.GenerateMock <IBlobClient>(); IBlobContainer mockBlobContainer = MockRepository.GenerateMock <IBlobContainer>(); mockBlobContainer.Expect(m => m.DownloadToStream(null, null)).IgnoreArguments().Do(new Action <string, Stream>((address, target) => { byte[] byteArray = File.ReadAllBytes(address); target.Write(byteArray, 0, (int)byteArray.Length); })); mockBlobContainer.Expect(m => m.UploadFromStream(null, null)).IgnoreArguments().Do(new Action <string, Stream>((address, stream) => { File.WriteAllBytes(address, ((MemoryStream)stream).ToArray()); })); mockBlobClient.Expect(m => m.CreateContainer(null)).IgnoreArguments().Return(mockBlobContainer); MockUserAuditor = MockRepository.GenerateMock <IUserAuditor>(); Target = new PrivateHealthFieldManager(Repositories.MockRepositoryContainer, mockBlobClient, MockDataTableBinder, MockUserAuditor); ExportFileFactory.SetCurrent(MockRepository.GenerateMock <IExportFileFactory>()); }
public void InitializeTest() { IBlobClient mockBlobClient = MockRepository.GenerateMock<IBlobClient>(); IBlobContainer mockBlobContainer = MockRepository.GenerateMock<IBlobContainer>(); mockBlobContainer.Expect(m => m.DownloadToStream(null, null)).IgnoreArguments().Do(new Action<string, Stream>((address, target) => { byte[] byteArray = File.ReadAllBytes(address); target.Write(byteArray, 0, (int)byteArray.Length); })); mockBlobContainer.Expect(m => m.UploadFromStream(null, null)).IgnoreArguments().Do(new Action<string, Stream>((address, stream) => { File.WriteAllBytes(address, ((MemoryStream)stream).ToArray()); })); mockBlobClient.Expect(m => m.CreateContainer(null)).IgnoreArguments().Return(mockBlobContainer); MockUserAuditor = MockRepository.GenerateMock<IUserAuditor>(); Target = new PrivateHealthFieldManager(Repositories.MockRepositoryContainer, mockBlobClient, MockDataTableBinder, MockUserAuditor); ExportFileFactory.SetCurrent(MockRepository.GenerateMock<IExportFileFactory>()); }