Wrox Programmer Forums
Visual Basic 2010 General Discussion For any discussions about Visual Basic 2010 topics which aren't related to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2010 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 6th, 2013, 09:53 AM
Registered User
Join Date: Jun 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unit test

I have to modify the code to set index = 0, expected.lat = 33.63944 and expected.lon = 84.42806. and Set delta in each Assert.AreEqual call to 0.00001 to allow for rounding error.

Here is the source code for the unit test.

Function IndexToCoordinatePair(ByVal Index1 As Integer, ByVal Index2 As Integer) As Double()
Dim array(4) As Double
array(0) = DegreesToRadians(CoordinateToDegrees(Hubs(Index1). Lat))
array(1) = DegreesToRadians(CoordinateToDegrees(Hubs(Index2). Lat))
array(2) = DegreesToRadians(CoordinateToDegrees(Hubs(Index1). Lon))
array(3) = DegreesToRadians(CoordinateToDegrees(Hubs(Index2). Lon))
Return array
End Function

And this is some of the test code.

'''A test for IndexToCoordinatePair
<TestMethod()> _
Public Sub IndexToCoordinatePairTest()
Dim target As Airports = New Airports() ' TODO: Initialize to an appropriate value
Dim Index1 As Integer = 0 ' TODO: Initialize to an appropriate value
Dim Index2 As Integer = 0 ' TODO: Initialize to an appropriate value
Dim expected() As Double = Nothing ' TODO: Initialize to an appropriate value
Dim actual() As Double
actual = target.IndexToCoordinatePair(Index1, Index2)
Assert.AreEqual(expected, actual)
Assert.Inconclusive("Verify the correctness of this test method.")
End Sub
End Class

I would like to know how to incoporate the required code to the test.

Similar Threads
Thread Thread Starter Forum Replies Last Post
unit test code download jronay BOOK: Professional ASP.NET Design Patterns 0 December 22nd, 2012 12:31 PM
Chapter 7 Unit Testing with the Unit Test Framework - examples blaurence46 BOOK: Professional Application Lifecycle Management with Visual Studio 2010 1 September 24th, 2011 10:07 AM
about unit test samvan BOOK: Professional ASP.NET Design Patterns 1 November 13th, 2010 06:32 AM
How to unit test IDataErrorInfo? chobo2 ASP.NET 3.5 Basics 0 August 21st, 2009 12:31 AM
Unit Test josericardo_jr BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 0 August 9th, 2007 08:19 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.