-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_1480_Running_sum_of_1d_array_Test.cs
More file actions
54 lines (44 loc) · 1.35 KB
/
_1480_Running_sum_of_1d_array_Test.cs
File metadata and controls
54 lines (44 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Solution._1480.Running_sum_of_1d_array;
using FluentAssertions;
namespace _1480.Running_sum_of_1d_array.Tests
{
[TestClass()]
public class _1480_Running_sum_of_1d_array_Test
{
_1480_Running_sum_of_1d_array solution = new _1480_Running_sum_of_1d_array();
[TestMethod()]
public void RunningSum_Test1()
{
// Arrange
int[] nums = { 1, 2, 3, 4 };
int[] expected = { 1, 3, 6, 10 };
// Act
var actual = solution.RunningSum(nums);
// Assert
actual.Should().BeEquivalentTo(expected);
}
[TestMethod()]
public void RunningSum_Test2()
{
// Arrange
int[] nums = { 1, 1, 1, 1, 1 };
int[] expected = { 1, 2, 3, 4, 5 };
// Act
var actual = solution.RunningSum(nums);
// Assert
actual.Should().BeEquivalentTo(expected);
}
[TestMethod()]
public void RunningSum_Test3()
{
// Arrange
int[] nums = { 3, 1, 2, 10, 1 };
int[] expected = { 3, 4, 6, 16, 17 };
// Act
var actual = solution.RunningSum(nums);
// Assert
actual.Should().BeEquivalentTo(expected);
}
}
}