Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created October 24, 2020 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xximjasonxx/41c3e36157b171b418529adb00414cb0 to your computer and use it in GitHub Desktop.
Save xximjasonxx/41c3e36157b171b418529adb00414cb0 to your computer and use it in GitHub Desktop.
public class given_an_instance_of_calculation_controller
{
[Fact]
public void assert_that_given_two_numbers_the_result_returned_is_the_correct_sum()
{
// arrange
var controller = new CalculationController();
var viewModel = new TwoNumberViewModel
{
FirstNumber = 10,
SecondNumber = 20
};
// act
var result = controller.Add(viewModel) as OkObjectResult;
// assert
Assert.NotNull(result);
Assert.Equal("30", result.Value.ToString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment