public static FormulaResponse ToModel(this FormulaName formula) { FormulaResponse model = new FormulaResponse(); model.Title = formula.Title; model.TypeName = formula.TypeName; return(model); }
public void TestStringifyResult() { // Arrange var input = new FormulaResponse { Result = "20 + (10 - 5)", Errors = new Errors() }; // Act var parser = new XmlParser(); var result = parser.Stringify(input); // Assert Approvals.Verify(result); }
public void TestStringifyError() { // Arrange var input = new FormulaResponse { Result = string.Empty, Errors = new Errors { Error = new string[] { "Error1", "Error2" } } }; // Act var parser = new XmlParser(); var result = parser.Stringify(input); // Assert Approvals.Verify(result); }