forked from Thorium/Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnitTest1.cs
61 lines (49 loc) · 1.53 KB
/
UnitTest1.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
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ClassLibrary1;
using System.Timers;
namespace TestProject3
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethodStocks()
{
var url = Stocks.MakeUrl("MSFT",
new DateTime(2000, 9, 15),
new DateTime(2000, 10, 18)
);
var res = Stocks.GetResult(url);
var closerate = Stocks.DateMaxClose(res);
Assert.IsTrue(closerate.Item2 > 20);
}
[TestMethod]
public void TestMethodNewCode()
{
var l = new NewCode();
var url = NewCode.MakeUrl("MSFT",
new DateTime(2000, 9, 15),
new DateTime(2000, 10, 18)
);
var res = l.GetResult(url);
var closerate = l.DateMaxClose(res);
Assert.IsTrue(closerate.Item2 > 20);
}
[TestMethod]
public void TestMethodLegacyCode()
{
var l = new LegacyCode();
var url = LegacyCode.MakeUrl("MSFT",
new DateTime(2000,9,15),
new DateTime(2000,10,18)
);
var res = l.GetResult(url);
var closerate = l.DateMaxClose(res);
Assert.IsTrue(closerate.Item2 > 20);
}
}
}