コード例 #1
0
        public static void TestActiveFileCollectionEnumerationConstructor()
        {
            IDataStore decryptedFileInfo1 = New <IDataStore>(Path.Combine(_rootPath, "test1.txt"));
            IDataStore encryptedFileInfo1 = New <IDataStore>(Path.Combine(_rootPath, "test1-txt.axx"));
            IDataStore decryptedFileInfo2 = New <IDataStore>(Path.Combine(_rootPath, "test2.txt"));
            IDataStore encryptedFileInfo2 = New <IDataStore>(Path.Combine(_rootPath, "test2-text.axx"));
            ActiveFile activeFile1        = new ActiveFile(encryptedFileInfo1, decryptedFileInfo1, new LogOnIdentity("newA"), ActiveFileStatus.None, new V1Aes128CryptoFactory().CryptoId);
            ActiveFile activeFile2        = new ActiveFile(encryptedFileInfo2, decryptedFileInfo2, new LogOnIdentity("newB"), ActiveFileStatus.None, new V1Aes128CryptoFactory().CryptoId);

            ActiveFileCollection collection = new ActiveFileCollection(new ActiveFile[] { activeFile1, activeFile2 });

            Assert.That(collection.Count, Is.EqualTo(2), "There should be two entries in the collection.");

            Assert.That(collection.First(), Is.EqualTo(activeFile1), "This should be the first in the collection.");
            Assert.That(collection.Last(), Is.EqualTo(activeFile2), "This should be the last in the collection.");
        }
コード例 #2
0
        public static void TestActiveFileCollectionEnumerationConstructor()
        {
            IRuntimeFileInfo decryptedFileInfo1 = OS.Current.FileInfo(Path.Combine(_rootPath, "test1.txt"));
            IRuntimeFileInfo encryptedFileInfo1 = OS.Current.FileInfo(Path.Combine(_rootPath, "test1-txt.axx"));
            IRuntimeFileInfo decryptedFileInfo2 = OS.Current.FileInfo(Path.Combine(_rootPath, "test2.txt"));
            IRuntimeFileInfo encryptedFileInfo2 = OS.Current.FileInfo(Path.Combine(_rootPath, "test2-text.axx"));
            ActiveFile activeFile1 = new ActiveFile(encryptedFileInfo1, decryptedFileInfo1, new AesKey(), ActiveFileStatus.None, null);
            ActiveFile activeFile2 = new ActiveFile(encryptedFileInfo2, decryptedFileInfo2, new AesKey(), ActiveFileStatus.None, null);

            ActiveFileCollection collection = new ActiveFileCollection(new ActiveFile[] { activeFile1, activeFile2 });

            Assert.That(collection.Count, Is.EqualTo(2), "There should be two entries in the collection.");

            Assert.That(collection.First(), Is.EqualTo(activeFile1), "This should be the first in the collection.");
            Assert.That(collection.Last(), Is.EqualTo(activeFile2), "This should be the last in the collection.");
        }
コード例 #3
0
        public static void TestActiveFileCollectionEnumerationConstructor()
        {
            IRuntimeFileInfo decryptedFileInfo1 = OS.Current.FileInfo(Path.Combine(_rootPath, "test1.txt"));
            IRuntimeFileInfo encryptedFileInfo1 = OS.Current.FileInfo(Path.Combine(_rootPath, "test1-txt.axx"));
            IRuntimeFileInfo decryptedFileInfo2 = OS.Current.FileInfo(Path.Combine(_rootPath, "test2.txt"));
            IRuntimeFileInfo encryptedFileInfo2 = OS.Current.FileInfo(Path.Combine(_rootPath, "test2-text.axx"));
            ActiveFile activeFile1 = new ActiveFile(encryptedFileInfo1, decryptedFileInfo1, new AesKey(), ActiveFileStatus.None, null);
            ActiveFile activeFile2 = new ActiveFile(encryptedFileInfo2, decryptedFileInfo2, new AesKey(), ActiveFileStatus.None, null);

            ActiveFileCollection collection = new ActiveFileCollection(new ActiveFile[] { activeFile1, activeFile2 });

            Assert.That(collection.Count, Is.EqualTo(2), "There should be two entries in the collection.");

            Assert.That(collection.First(), Is.EqualTo(activeFile1), "This should be the first in the collection.");
            Assert.That(collection.Last(), Is.EqualTo(activeFile2), "This should be the last in the collection.");
        }
コード例 #4
0
        public static void TestActiveFileCollectionSimpleConstructor()
        {
            ActiveFileCollection collection = new ActiveFileCollection(new ActiveFile[0]);

            IDataStore decryptedFileInfo = New <IDataStore>(_testTextPath);
            IDataStore encryptedFileInfo = New <IDataStore>(_helloWorldAxxPath);
            ActiveFile activeFile        = new ActiveFile(encryptedFileInfo, decryptedFileInfo, new LogOnIdentity("new"), ActiveFileStatus.None, new V1Aes128CryptoFactory().CryptoId);

            collection.Add(activeFile);

            Assert.That(collection.Count, Is.EqualTo(1), "There should be one entry in the collection.");

            foreach (ActiveFile member in collection)
            {
                Assert.That(member, Is.EqualTo(activeFile), "The one we added should now be in the collection.");
            }
        }
コード例 #5
0
        public static void TestActiveFileCollectionSimpleConstructor()
        {
            ActiveFileCollection collection = new ActiveFileCollection();

            IRuntimeFileInfo decryptedFileInfo = OS.Current.FileInfo(_testTextPath);
            IRuntimeFileInfo encryptedFileInfo = OS.Current.FileInfo(_helloWorldAxxPath);
            ActiveFile activeFile = new ActiveFile(encryptedFileInfo, decryptedFileInfo, new AesKey(), ActiveFileStatus.None, null);

            collection.Add(activeFile);

            Assert.That(collection.Count, Is.EqualTo(1), "There should be one entry in the collection.");

            foreach (ActiveFile member in collection)
            {
                Assert.That(member, Is.EqualTo(activeFile), "The one we added should now be in the collection.");
            }
        }
コード例 #6
0
        public static void TestActiveFileCollectionSimpleConstructor()
        {
            ActiveFileCollection collection = new ActiveFileCollection();

            IRuntimeFileInfo decryptedFileInfo = OS.Current.FileInfo(_testTextPath);
            IRuntimeFileInfo encryptedFileInfo = OS.Current.FileInfo(_helloWorldAxxPath);
            ActiveFile activeFile = new ActiveFile(encryptedFileInfo, decryptedFileInfo, new AesKey(), ActiveFileStatus.None, null);

            collection.Add(activeFile);

            Assert.That(collection.Count, Is.EqualTo(1), "There should be one entry in the collection.");

            foreach (ActiveFile member in collection)
            {
                Assert.That(member, Is.EqualTo(activeFile), "The one we added should now be in the collection.");
            }
        }