Esempio n. 1
0
        public void ReadFromAFile()
        {
            string fileName = Directory.GetFiles(GetTestDataPath(), "*.csv", SearchOption.TopDirectoryOnly).First();

            var result = ObfuscationLookupHelper.ReadFromFile(fileName);

            result.Should().BeOfType(typeof(ObfuscationLookup));
        }
Esempio n. 2
0
        private static void LoadObfuscationLookups()
        {
            var lookupPath = GetLookupFolderPath();

            if (Directory.Exists(lookupPath))
            {
                ObfuscationLookupHelper.LoadLookups(lookupPath);
            }
        }
Esempio n. 3
0
        public void ThrowAnExceptionIfNoLookupFilesCanBeFound()
        {
            string folderPath = Path.Combine(GetTestDataPath(), "EmptyFolder");

            // Act
            Action action = () => ObfuscationLookupHelper.LoadLookups(folderPath);

            action.Should().Throw <FileNotFoundException>();
        }
Esempio n. 4
0
        public void LoadLookupsFromAFolderPath()
        {
            string folderPath = GetTestDataPath();
            int    fileCount  = Directory.GetFiles(folderPath, "*.csv", SearchOption.TopDirectoryOnly).Length;

            ObfuscationLookupHelper.LoadLookups(folderPath);

            ObfuscationLookupHelper.ObfuscationLookups.Count.Should().Be(fileCount);
        }
Esempio n. 5
0
        public void ClearTheLookupList()
        {
            string folderPath = GetTestDataPath();

            ObfuscationLookupHelper.LoadLookups(folderPath);

            int lookupCount = ObfuscationLookupHelper.ObfuscationLookups.Count;

            ObfuscationLookupHelper.CleanLookups();

            ObfuscationLookupHelper.ObfuscationLookups.Count.Should().BeLessThan(lookupCount);
        }
Esempio n. 6
0
        public void ClearTheLookupList()
        {
            string folderPath = GetTestDataPath();
            int    fileCount  = System.IO.Directory.GetFiles(folderPath, "*.csv", SearchOption.TopDirectoryOnly).Length;

            ObfuscationLookupHelper.LoadLookups(folderPath);

            int lookupCount = ObfuscationLookupHelper.ObfuscationLookups.Count;

            ObfuscationLookupHelper.CleanLookups();

            ObfuscationLookupHelper.ObfuscationLookups.Count.Should().BeLessThan(lookupCount);
        }
Esempio n. 7
0
        public void LoadLookupFromADictionary()
        {
            Dictionary <string, ObfuscationLookup> lookups = new Dictionary <string, ObfuscationLookup>();
            string fileName = Directory.GetFiles(GetTestDataPath(), "*.csv", SearchOption.TopDirectoryOnly).First();

            var result = ObfuscationLookupHelper.ReadFromFile(fileName);

            lookups.Add("testLookup.csv", result);
            int lookupCount = lookups.Count;

            ObfuscationLookupHelper.LoadLookups(lookups);

            ObfuscationLookupHelper.ObfuscationLookups.Count.Should().Be(lookupCount);
        }
 private static void LoadObfuscationLookups()
 {
     ObfuscationLookupHelper.LoadLookups(GetLookupFolderPath());
 }