datasetwstest.vb
来自「wrox出版社的另一套经典的VB2005数据库编程学习书籍,收集了书中源码,郑重」· VB 代码 · 共 76 行
VB
76 行
Imports System.Data
Imports DataSetWSClient.DataSetWS
Imports Microsoft.VisualStudio.QualityTools.UnitTesting.Framework
'''<summary>
'''This is a test class for DataSetWSClient.DataSetWS.DataSetWS and is intended
'''to contain all DataSetWSClient.DataSetWS.DataSetWS Unit Tests
'''</summary>
<TestClass()> _
Public Class DataSetWSTest
Private testContextInstance As TestContext
'''<summary>
'''Gets or sets the test context which provides
'''information about and functionality for the current test run.
'''</summary>
Public Property TestContext() As TestContext
Get
Return testContextInstance
End Get
Set(ByVal value As TestContext)
testContextInstance = value
End Set
End Property
'''<summary>
'''Initialize() is called once during test execution before
'''test methods in this test class are executed.
'''</summary>
<TestInitialize()> _
Public Sub Initialize()
' TODO: Add test initialization code
End Sub
'''<summary>
'''Cleanup() is called once during test execution after
'''test methods in this class have executed unless
'''this test class' Initialize() method throws an exception.
'''</summary>
<TestCleanup()> _
Public Sub Cleanup()
' TODO: Add test cleanup code
End Sub
'''<summary>
'''A test case for GetAllCustomers()
'''</summary>
<TestMethod()> _
Public Sub GetAllCustomersTest()
Dim target As DataSetWS = New DataSetWS
Dim expected As DataSet = Nothing
Dim actual As DataSet
actual = target.GetAllCustomers
Assert.AreNotEqual(expected, actual, "DataSetWSClient.DataSetWS.DataSetWS.GetAllCustomers did not return the expected value.")
'Assert.Inconclusive("Verify the correctness of this test method.")
End Sub
'''<summary>
'''A test case for GetOrdersByCustomerID(String)
'''</summary>
<TestMethod()> _
Public Sub GetOrdersByCustomerIDTest()
Dim target As DataSetWS = New DataSetWS
Dim CustomerID As String = "RATTC" 'Nothing 'TODO: Initialize to an appropriate value
Dim expected As DataSet = Nothing
Dim actual As DataSet
actual = target.GetOrdersByCustomerID(CustomerID)
Assert.AreNotEqual(expected, actual, "DataSetWSClient.DataSetWS.DataSetWS.GetOrdersByCustomerID did not return the expected value.")
'Assert.Inconclusive("Verify the correctness of this test method.")
End Sub
End Class
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?