コード例 #1
0
 public void SelectReaderWriter_ShouldThrow_GivenOnlyUnprotectedRegisteredAndTrue()
 {
     this.subject = new LocalDiskReaderWriterSelector(new List <IFileReaderWriter> {
         new LocalDiskReaderWriter()
     });
     this.subject.SelectReaderWriter(true);
     Assert.Fail();
 }
コード例 #2
0
        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();
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 public void SelectReaderWriter_ShouldThrow_GivenNoReaderWriters()
 {
     this.subject = new LocalDiskReaderWriterSelector(new List <IFileReaderWriter>());
     this.subject.SelectReaderWriter(true);
     Assert.Fail();
 }