My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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;

namespace Hef.TopCoder.Srm145.Div2
{
[TestClass]
public class VendingMachineTest : VendingMachine
{
[TestMethod]
public void TestExample0()
{
string[] prices = { "100 100 100" };
string[] purchases = { "0,0:0", "0,2:5", "0,1:10" };

Assert.AreEqual<int>(4, this.motorUse(prices, purchases));
}

[TestMethod]
public void TestExample1()
{
string[] prices = { "100 200 300 400 500 600" };
string[] purchases = { "0,2:0", "0,3:5", "0,1:10", "0,4:15" };

Assert.AreEqual<int>(17, this.motorUse(prices, purchases));
}

[TestMethod]
public void TestExample2()
{
string[] prices = { "100 200 300 400 500 600" };
string[] purchases = { "0,2:0", "0,3:4", "0,1:8", "0,4:12" };

Assert.AreEqual<int>(11, this.motorUse(prices, purchases));
}

[TestMethod]
public void TestExample3()
{
string[] prices = { "100 100 100" };
string[] purchases = { "0,0:10", "0,0:11" };

Assert.AreEqual<int>(-1, this.motorUse(prices, purchases));
}

[TestMethod]
public void TestExample4()
{
string[] prices = { "100 200 300", "600 500 400" };
string[] purchases = { "0,0:0", "1,1:10", "1,2:20", "0,1:21", "1,0:22", "0,2:35" };

Assert.AreEqual<int>(6, this.motorUse(prices, purchases));
}
}
}

Change log

r5 by jonathan.hefner on Jun 22, 2008   Diff
Sync
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1451 bytes, 54 lines
Powered by Google Project Hosting