public void Should_Return_False_When_Source_Type_Is_Not_DirectoryPath() { var converter = new DirectoryPathConverter(); var result = converter.CanConvertTo(typeof(DateTime)); Assert.False(result); }
public void Should_Return_True_When_Destination_Type_Is_DirectoryPath() { var converter = new DirectoryPathConverter(); var result = converter.CanConvertTo(typeof(DirectoryPath)); Assert.True(result); }
public void Should_Throw_NotSupportedException_When_Value_Is_Not_A_Valid_Directory_Path() { var converter = new DirectoryPathConverter(); var result = Record.Exception(() => converter.ConvertFrom(DateTime.Now)); Assert.IsType <NotSupportedException>(result); }
public void Should_Return_True_When_Source_Type_Is_String() { var converter = new DirectoryPathConverter(); var result = converter.CanConvertFrom(typeof(string)); Assert.True(result); }
public void Should_Convert_Directory_Path_To_String_Value_Using_FullPath() { var converter = new DirectoryPathConverter(); var result = converter.ConvertTo(DirectoryPath.FromString("c:/data/work"), typeof(string)); Assert.IsType <string>(result); Assert.Equal("c:/data/work", result); }
public void Should_Convert_String_Value_To_Directory_Path() { var converter = new DirectoryPathConverter(); var result = converter.ConvertFrom("c:/data/work"); Assert.IsType <DirectoryPath>(result); Assert.Equal("c:/data/work", ((DirectoryPath)result).FullPath); }
public void Should_Throw_NotSupportedException_When_Destination_Type_Is_Not_String() { var converter = new DirectoryPathConverter(); var result = Record.Exception(() => converter.ConvertTo(DirectoryPath.FromString("c:/data/work"), typeof(DateTime))); Assert.IsType <NotSupportedException>(result); }