public void SelectReaderWriter_ShouldThrow_GivenOnlyUnprotectedRegisteredAndTrue() { this.subject = new LocalDiskReaderWriterSelector(new List <IFileReaderWriter> { new LocalDiskReaderWriter() }); this.subject.SelectReaderWriter(true); Assert.Fail(); }
public void SelectReaderWriter_ShouldThrow_GivenOnlyEncryptedRegisteredAndFalse() { var mockCredentials = new Mock <ICredentialStore>().Object; var mockFileEncryptor = new Mock <IFileEncryptor>().Object; this.subject = new LocalDiskReaderWriterSelector(new List <IFileReaderWriter> { new EncryptedLocalDiskReaderWriter(mockFileEncryptor, mockCredentials) }); this.subject.SelectReaderWriter(false); Assert.Fail(); }
public void SelectReaderWriter_ShouldReturnUnprotected_GivenFalse() { var mockCredentials = new Mock <ICredentialStore>().Object; var mockFileEncryptor = new Mock <IFileEncryptor>().Object; this.subject = new LocalDiskReaderWriterSelector( new List <IFileReaderWriter> { new EncryptedLocalDiskReaderWriter(mockFileEncryptor, mockCredentials), new LocalDiskReaderWriter() }); var result = this.subject.SelectReaderWriter(false); Assert.IsInstanceOfType(result, typeof(LocalDiskReaderWriter)); }
public void SelectReaderWriter_ShouldThrow_GivenNoReaderWriters() { this.subject = new LocalDiskReaderWriterSelector(new List <IFileReaderWriter>()); this.subject.SelectReaderWriter(true); Assert.Fail(); }