public void GenerateNumericalWords() { var valid = Builtin.ChineseChars?.Length > 0; if (!valid) { throw new InvalidOperationException("Builtin.ChineseChars is empty."); } var gen = new NumericalGenerator(); gen.OnOutput += output => Debug.WriteLine(output); var code = gen.Generate(); File.WriteAllText("../../../Codes/Builtin/NumericalWords.cs", code); }
public void CheckOutput() { // Arrange var g = new NumericalGenerator(); // Act int n = 1042; for (int i = 0; i < n; i++) { g.Next(); } // Assert Assert.Equal(n.ToString(), g.Next()); }