public void GetTestPassTest() { //Arrange controller = new ConversionController(this._captureNumber.Object); //Act var response = controller.Get("John", "Smith", "12.44"); //Assert Assert.AreEqual("twelve dollars and fourty four cents", response.AmountinText); Assert.AreEqual("John", response.FirstName); Assert.AreEqual("Smith", response.LastName); Assert.AreEqual(12.44, response.Amount); }
public void GetTestFailTest() { //Arrange controller = new ConversionController(this._captureNumber.Object); //Act try { var response = controller.Get(null, null, " "); } catch (Exception ex) { //Assert Assert.AreEqual("Input string was not in a correct format.", ex.Message); } }
public void GetWithNoName() { string name = ""; // Act var result = controller.Get(name, "100"); var model = GetModel(result); // Assert Assert.IsNull(model.Name); Assert.IsNull(model.Currency); Assert.AreEqual(Constants.RequiredName, model.ErrorMessage); }