-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_0215_Kth_largest_element_in_an_array_Test.cs
More file actions
41 lines (34 loc) · 1.08 KB
/
_0215_Kth_largest_element_in_an_array_Test.cs
File metadata and controls
41 lines (34 loc) · 1.08 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
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Solution._0215.Kth_largest_element_in_an_array;
namespace _0215.Kth_largest_element_in_an_array.Tests
{
[TestClass()]
public class _0215_Kth_largest_element_in_an_array_Test
{
_0215_Kth_largest_element_in_an_array solution = new _0215_Kth_largest_element_in_an_array();
[TestMethod()]
public void FindKthLargest_Test1()
{
// Arrange
int[] nums = new int[] { 3, 2, 1, 5, 6, 4 };
int k = 2;
var expected = 5;
// Act
var actual = solution.FindKthLargest(nums, k);
// Assert
Assert.AreEqual(expected, actual);
}
[TestMethod()]
public void FindKthLargest_Test2()
{
// Arrange
int[] nums = new int[] { 3, 2, 3, 1, 2, 4, 5, 5, 6 };
int k = 4;
var expected = 4;
// Act
var actual = solution.FindKthLargest(nums, k);
// Assert
Assert.AreEqual(expected, actual);
}
}
}