Develop and Download Open Source Software

Browse Subversion Repository

Contents of /ShogiNextMove.Test/LocationTest.vb

Parent Directory Parent Directory | Revision Log Revision Log


Revision 76 - (show annotations) (download)
Mon Feb 22 06:48:06 2016 UTC (8 years ago) by bellyoshi
File size: 3526 byte(s)


1 Imports Microsoft.VisualStudio.TestTools.UnitTesting
2
3 Imports ShogiNextMove.Board
4
5
6
7 '''<summary>
8 '''LocationTest のテスト クラスです。すべての
9 '''LocationTest 単体テストをここに含めます
10 '''</summary>
11 <TestClass()> _
12 Public Class LocationTest
13
14
15 Private testContextInstance As TestContext
16
17 '''<summary>
18 '''現在のテストの実行についての情報および機能を
19 '''提供するテスト コンテキストを取得または設定します。
20 '''</summary>
21 Public Property TestContext() As TestContext
22 Get
23 Return testContextInstance
24 End Get
25 Set(value As TestContext)
26 testContextInstance = Value
27 End Set
28 End Property
29
30 #Region "追加のテスト属性"
31 '
32 'テストを作成するときに、次の追加属性を使用することができます:
33 '
34 'クラスの最初のテストを実行する前にコードを実行するには、ClassInitialize を使用
35 '<ClassInitialize()> _
36 'Public Shared Sub MyClassInitialize(ByVal testContext As TestContext)
37 'End Sub
38 '
39 'クラスのすべてのテストを実行した後にコードを実行するには、ClassCleanup を使用
40 '<ClassCleanup()> _
41 'Public Shared Sub MyClassCleanup()
42 'End Sub
43 '
44 '各テストを実行する前にコードを実行するには、TestInitialize を使用
45 '<TestInitialize()> _
46 'Public Sub MyTestInitialize()
47 'End Sub
48 '
49 '各テストを実行した後にコードを実行するには、TestCleanup を使用
50 '<TestCleanup()> _
51 'Public Sub MyTestCleanup()
52 'End Sub
53 '
54 #End Region
55
56
57 '''<summary>
58 '''ParseLocation のテスト
59 '''</summary>
60 <TestMethod()> _
61 Public Sub ParseLocationTest()
62 Dim actual As komaLocation
63 actual = KomaLocation.ParseLocation("00")
64 Assert.AreEqual(True, actual.IsMochigoma)
65 End Sub
66
67 '''<summary>
68 '''ParseLocation のテスト
69 '''</summary>
70 <TestMethod()> _
71 Public Sub ParseLocationTest2()
72 Dim actual As KomaLocation
73 actual = KomaLocation.ParseLocation("31")
74 Assert.AreEqual(False, actual.IsMochigoma)
75 Assert.AreEqual(1, actual.Row)
76 Assert.AreEqual(3, actual.Col)
77 End Sub
78
79 <TestMethod()> _
80 Public Sub EqualTest()
81 Dim target1 As New KomaLocation(1, 1)
82 Dim target2 As New KomaLocation(2, 1)
83 Dim target3 As New KomaLocation(1, 1)
84 Dim target4 As KomaLocation = KomaLocation.Mochigoma
85 Dim target5 As KomaLocation = KomaLocation.KomaBako
86 Dim target6 As KomaLocation = KomaLocation.Mochigoma
87 Dim target7 As KomaLocation = KomaLocation.KomaBako
88 Assert.IsTrue(target1.Equals(target1))
89 Assert.IsTrue(target1.Equals(target3))
90 Assert.IsFalse(target1.Equals(target2))
91 Assert.IsFalse(target1.Equals(target4))
92 Assert.IsFalse(target1.Equals(target5))
93 Assert.IsFalse(target1.Equals(target6))
94 Assert.IsFalse(target1.Equals(target7))
95 Assert.IsTrue(target4.Equals(target4))
96 Assert.IsFalse(target4.Equals(target5))
97 Assert.IsTrue(target4.Equals(target6))
98 Assert.IsFalse(target4.Equals(target7))
99 Assert.IsTrue(target5.Equals(target5))
100 Assert.IsFalse(target5.Equals(target6))
101 Assert.IsTrue(target5.Equals(target7))
102
103 End Sub
104 End Class

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26