-
Notifications
You must be signed in to change notification settings - Fork 0
/
_1800_Maximum_ascending_subarray_sum_Test.cs
67 lines (54 loc) · 1.67 KB
/
_1800_Maximum_ascending_subarray_sum_Test.cs
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
55
56
57
58
59
60
61
62
63
64
65
66
67
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Solution._1800.Maximum_ascending_subarray_sum;
namespace _1800.Maximum_ascending_subarray_sum.Tests
{
[TestClass()]
public class _1800_Maximum_ascending_subarray_sum_Test
{
_1800_Maximum_ascending_subarray_sum solution = new _1800_Maximum_ascending_subarray_sum();
[TestMethod()]
public void MaxAscendingSum_Test1()
{
// Arrange
int[] nums = { 10, 20, 30, 5, 10, 50 };
var expected = 65;
// Act
var actual = solution.MaxAscendingSum(nums);
// Assert
Assert.AreEqual(expected, actual);
}
[TestMethod()]
public void MaxAscendingSum_Test2()
{
// Arrange
int[] nums = { 10, 20, 30, 40, 50 };
var expected = 150;
// Act
var actual = solution.MaxAscendingSum(nums);
// Assert
Assert.AreEqual(expected, actual);
}
[TestMethod()]
public void MaxAscendingSum_Test3()
{
// Arrange
int[] nums = { 12, 17, 15, 13, 10, 11, 12 };
var expected = 33;
// Act
var actual = solution.MaxAscendingSum(nums);
// Assert
Assert.AreEqual(expected, actual);
}
[TestMethod()]
public void MaxAscendingSum_Test4()
{
// Arrange
int[] nums = { 100, 10, 1 };
var expected = 100;
// Act
var actual = solution.MaxAscendingSum(nums);
// Assert
Assert.AreEqual(expected, actual);
}
}
}