protected string GetExpectedMessage(ExpectedActualDirPair expectedActualDirPair) { var fieldName = TestContext.CurrentContext.Test.Name + "ExpectedMessage"; var fieldInfo = GetType().GetField( fieldName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy); Assert.IsTrue(fieldInfo != null, "fieldInfo != null"); Assert.IsTrue(fieldInfo.FieldType == typeof(string), "fieldInfo.FieldType == typeof(string)"); var fieldValue = (string)fieldInfo.GetValue(this); return(string.Format(fieldValue, expectedActualDirPair.Expected.Url, expectedActualDirPair.Actual.Url)); }
protected ExpectedActualDirPair GetDirPair() { var testDataRootDir = GetTestDataDir(); var expectedDirectoryPath = Path.Combine(testDataRootDir, "2exp"); var expectedDataDir = new DefaultFileSystemDirectory(expectedDirectoryPath); expectedDataDir.CreateRecursivelyIfDoesNotExist(); var actualDirectoryPath = Path.Combine(testDataRootDir, "3act"); var actualDataDir = new DefaultFileSystemDirectory(actualDirectoryPath); actualDataDir.CreateRecursivelyIfDoesNotExist(); var dirPair = new ExpectedActualDirPair(expectedDataDir, actualDataDir); return(dirPair); }