public void ReadFromAFile() { string fileName = Directory.GetFiles(GetTestDataPath(), "*.csv", SearchOption.TopDirectoryOnly).First(); var result = ObfuscationLookupHelper.ReadFromFile(fileName); result.Should().BeOfType(typeof(ObfuscationLookup)); }
private static void LoadObfuscationLookups() { var lookupPath = GetLookupFolderPath(); if (Directory.Exists(lookupPath)) { ObfuscationLookupHelper.LoadLookups(lookupPath); } }
public void ThrowAnExceptionIfNoLookupFilesCanBeFound() { string folderPath = Path.Combine(GetTestDataPath(), "EmptyFolder"); // Act Action action = () => ObfuscationLookupHelper.LoadLookups(folderPath); action.Should().Throw <FileNotFoundException>(); }
public void LoadLookupsFromAFolderPath() { string folderPath = GetTestDataPath(); int fileCount = Directory.GetFiles(folderPath, "*.csv", SearchOption.TopDirectoryOnly).Length; ObfuscationLookupHelper.LoadLookups(folderPath); ObfuscationLookupHelper.ObfuscationLookups.Count.Should().Be(fileCount); }
public void ClearTheLookupList() { string folderPath = GetTestDataPath(); ObfuscationLookupHelper.LoadLookups(folderPath); int lookupCount = ObfuscationLookupHelper.ObfuscationLookups.Count; ObfuscationLookupHelper.CleanLookups(); ObfuscationLookupHelper.ObfuscationLookups.Count.Should().BeLessThan(lookupCount); }
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); }
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()); }