using Util.Generators.Contexts; using Xunit; namespace Util.Generators.Tests.Contexts { /// /// 输出测试 /// public class OutputTest { /// /// 测试输出路径 /// [Fact] public void TestPath() { var output = new Output { RootPath = @"c:\", RelativeRootPath = @"a\b", FileNameNoExtension = "e", Extension = ".cs" }; Assert.Equal( @"c:/a/b/e.cs", output.Path ); } /// /// 测试复制 /// [Fact] public void TestCopyTo() { var output = new Output { RootPath = "a", RelativeRootPath = "b", FileNameNoExtension = "c", Extension = "d", NamingConvention = NamingConvention.CamelCase }; var copy = new Output(); output.CopyTo( copy ); Assert.Equal( "a",copy.RootPath ); Assert.Equal( "b", copy.RelativeRootPath ); Assert.Equal( "c", copy.FileNameNoExtension ); Assert.Equal( "d", copy.Extension ); Assert.Equal( NamingConvention.CamelCase, copy.NamingConvention ); } } }