public void GetAbsoluteResolvedPath_WithNormalPath_ShouldReturnNormalPath() { // Arrange const string testPath = @"C:/MyPath"; PathResolver pathFormatter = new PathResolver(testFileSystem.Object); testFileSystem.Setup(m => m.Path.GetFullPath(It.IsAny <string>())).Returns <string>(val => val); // Act string result = pathFormatter.GetAbsoluteResolvedPath(testPath, new List <Variable>()); // Assert Assert.AreEqual(testPath, result); }
public void GetAbsoluteResolvedPath_WithVariablePath_ShouldReturnResolvedPath() { // Arrange string testPath = $@"C:/Users/{ PathResolver.delimiter }User{ PathResolver.delimiter }/Desktop"; PathResolver pathFormatter = new PathResolver(testFileSystem.Object); var testVariables = new List <Variable>(new Variable[] { new Variable("User", "Frans") }); testFileSystem.Setup(m => m.Path.GetFullPath(It.IsAny <string>())).Returns <string>(val => val); // Act string result = pathFormatter.GetAbsoluteResolvedPath(testPath, testVariables); // Assert Assert.AreEqual(@"C:/Users/Frans/Desktop", result); }