public void TestGetMultiples() { //Arrange MultiplesViewModel multiplesViewModel = new MultiplesViewModel(); long expectedResult = 8; long expectedResult2 = 234168; //Act long acutalResult = multiplesViewModel.GetMultiples(5); long acutalResult2 = multiplesViewModel.GetMultiples(1000); // Assert Assert.Equal(expectedResult, acutalResult); Assert.Equal(expectedResult2, acutalResult2); }
private void BtnSum_Click(object sender, RoutedEventArgs e) { if (!long.TryParse(TbInput.Text, out long input)) { if (input == 0) { input = 1000; } } TbResult.Text = String.Format("{0}'s sum of multiples of all 3 or 5 is: {1}", input, multiplesViewModel.GetMultiples(input)); TbInput.Text = ""; }