public void Pluralize(double n, string expected) { var subject = new PluralFormatter(); var args = new Dictionary<string, object> { { "test", n } }; var arguments = new ParsedArguments( new[] { new KeyedBlock("zero", "nothing"), new KeyedBlock("one", "just one"), new KeyedBlock("other", "wow") }, new FormatterExtension[0]); var request = new FormatterRequest(new Literal(1, 1, 1, 1, new StringBuilder()), "test", "plural", null); var actual = subject.Pluralize("en", arguments, Convert.ToDouble(args[request.Variable]), 0); Assert.Equal(expected, actual); }
public void ReplaceNumberLiterals(string input, string expected) { var subject = new PluralFormatter(); var actual = subject.ReplaceNumberLiterals(new StringBuilder(input), 1337); Assert.Equal(expected, actual); }