单元测试在VS2015中暂停并且不运行。没有错误或警告消息

时间:2017-06-29 15:25:05

标签: vb.net unit-testing

我有一个名为DestinationTests()的简单VB.Net单元测试。当我在Test Explorer中选择测试并单击" Debug Selected Tests" item,消息显示在Test Explorer的下部窗格中:" DestinationTests Paused"。没有Resume选项。有一个开始选项。

测试显示在测试资源管理器中传递。未创建由单元测试创​​建的CSV文件。

整个周期持续时间最长,但测试资源管理器中的执行时间以分钟为单位报告。

单元测试源如下:

   <TestMethod()> Public Sub DestinationTests()

      Dim StandardSet As New GeoTestRoutes()

        GeoLibrary.InitInstance()

        Dim timer As New Stopwatch
        Dim distance As Double
        Dim lbLocation, ltLocation, rbLocation, rtLocation As Location
        Dim originLocation As New Location

        Using csvWriter As StreamWriter = New StreamWriter("C:\GeographicLib-master\Spreadsheets\RouteDestination.csv")

            csvWriter.WriteLine("Origin, Lat, Lon, Distance, LBLat, LBLon, RBLat, RBLon, RTLat, RTLon, LTLat, LTLon, Calculation Time ")

            For Each route As TestRoute In StandardSet.routes

                ' Compute a bounding box around the origin of 10 radii of 25 nmi to 275 nmi in increments of 25 nmi.
                For distance = 25 To 275 Step 25

                    timer.Reset()
                    timer.Start()

                    originLocation.Latitude = route.OriginLatitude
                    originLocation.Longitude = route.OriginLongitude

                    lbLocation = GeoLibrary.CalculateDestination(originLocation, distance * SQRTOFTWO, -3/4*Math.PI )
                    rbLocation = GeoLibrary.CalculateDestination(originLocation, distance * SQRTOFTWO, -1/4*Math.PI )

                    rtLocation= GeoLibrary.CalculateDestination(originLocation, distance * SQRTOFTWO, 1/4*Math.PI )
                    ltLocation= GeoLibrary.CalculateDestination(originLocation, distance * SQRTOFTWO, 3/4*Math.PI )

                    timer.Stop()

                    csvWriter.WriteLine("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12}",
                                        route.OriginGeoCode,
                                        route.OriginLatitude,
                                        route.OriginLongitude,
                                        distance,
                                        lbLocation.Latitude,
                                        lbLocation.Longitude,
                                        rbLocation.Latitude,
                                        rbLocation.Longitude,
                                        rtLocation.Latitude,
                                        rtLocation.Longitude,
                                        ltLocation.Latitude,
                                        ltLocation.Longitude,
                                        timer.ElapsedTicks)

                Next

            Next

        End Using

        GeoLibrary.Release()

    End Sub

0 个答案:

没有答案