Skip to content

CodeGenerate supports configuring Code length.

Compare
Choose a tag to compare
@maliming maliming released this 13 Apr 01:19
· 23 commits to master since this release
[Fact]
public void Test_CreateCode_With_Length()
{
	var generate = new GeneralTreeCodeGenerate(new GeneralTreeCodeGenerateConfiguration()
	{
		CodeLength = 3
	});

	generate.CreateCode().ShouldBe(null);
	generate.CreateCode(42).ShouldBe("042");
	generate.CreateCode(1, 2).ShouldBe("001.002");
	generate.CreateCode(1, 2, 3).ShouldBe("001.002.003");
}