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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Hef.TopCoder.Srm145.Div2
{
[TestClass]
public class ImageDitheringTest : ImageDithering
{
[TestMethod]
public void TestExample0()
{
string dithered = "BW";
string[] screen = { "AAAAAAAA",
"ABWBWBWA",
"AWBWBWBA",
"ABWBWBWA",
"AWBWBWBA",
"AAAAAAAA" };

Assert.AreEqual<int>(24, this.count(dithered, screen));
}

[TestMethod]
public void TestExample1()
{
string dithered = "BW";
string[] screen = { "BBBBBBBB",
"BBWBWBWB",
"BWBWBWBB",
"BBWBWBWB",
"BWBWBWBB",
"BBBBBBBB" };

Assert.AreEqual<int>(48, this.count(dithered, screen));
}

[TestMethod]
public void TestExample2()
{
string dithered = "ACEGIKMOQSUWY";
string[] screen = { "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX" };

Assert.AreEqual<int>(150, this.count(dithered, screen));
}

[TestMethod]
public void TestExample3()
{
string dithered = "CA";
string[] screen = { "BBBBBBB",
"BBBBBBB",
"BBBBBBB"};

Assert.AreEqual<int>(0, this.count(dithered, screen));
}

[TestMethod]
public void TestExample4()
{
string dithered = "DCBA";
string[] screen = { "ACBD" };

Assert.AreEqual<int>(4, this.count(dithered, screen));
}
}
}

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: 2112 bytes, 71 lines
Powered by Google Project Hosting