345 questions with Visual Studio Testing tags

Sort by: Updated
2 answers

Unit testing C++ CLR

What is the best approach to write Unit Tests for C++/CLR? We have a solution that includes C++ native, C++/CLR and C#.Net code. When I try to add a C++/CLR reference to a C#.net Unit Test project, it compiles, but when I run the tests it says…

.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
334 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,681 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-11-08T11:49:22.9+00:00
Günther Humer 1 Reputation point
answered 2022-12-13T16:41:03.227+00:00
Günther Humer 1 Reputation point
1 answer

How to write Unit test for DAL which call stored procedure and direct sql commands

Hello Everyone, I am writing unit test cases(using xunit) for DAL methods(which are calling stored procedures and some direct sql commands and not returning methods). How can I mock the results coming from db in unit tests. public class…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-12-10T22:50:24.95+00:00
Samuel David 21 Reputation points
answered 2022-12-11T18:55:54.67+00:00
Bruce (SqlWork.com) 63,501 Reputation points
1 answer One of the answers was accepted by the question author.

error System.Data.SqlClient.SqlException: 'Incorrect syntax near '´'.' in VB.NET (Windows Forms)

Im on vb.net framework version 4.8.1 Using an online database code Public Class register Private cmd As SqlCommand Private Sub register_btn_Click(sender As Object, e As EventArgs) Handles register_btn.Click Dim con As New…

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,711 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
986 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-12-06T20:55:46.483+00:00
Mariwa 21 Reputation points
accepted 2022-12-06T21:23:36.663+00:00
Mariwa 21 Reputation points
0 answers

Compile error when adding Xamarin iOS app to solution with .NET 6 NUnit test project

This came up as a result of attempting to upgrade our test projects from .NET Core 3.1 to .Net 6 in our solution that includes a Xamarin iOS app. It happens on the macOS-11 build agent in azure dev ops and also on my development mac running Visual Studio…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,333 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-12-01T20:33:27.143+00:00
Bob 6 Reputation points
commented 2022-12-02T13:58:46.747+00:00
Bob 6 Reputation points
0 answers

Microsoft.CodeCoverage.Console.exe don't remove C++ compile time code

Hello, I generate C++ code coverage with Microsoft.CodeCoverage.Console.exe. I have the following code : template<typename type_t> [[nodiscard]] static constexpr type_t* allocate_array(const usize count) noexcept…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,681 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-11-18T09:46:30.333+00:00
julian lalu 21 Reputation points
commented 2022-12-02T09:30:48.94+00:00
julian lalu 21 Reputation points
1 answer One of the answers was accepted by the question author.

uwp code coverage does not take effect

I created a UWP project and then created a UWP Unit Test. Running all tests is normal, but Analyze Code Coverage for All Tests is invalid and the result is 0 What can I do?

Universal Windows Platform (UWP)
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-12-01T14:09:32.343+00:00
华 张 156 Reputation points
commented 2022-12-02T06:47:47.367+00:00
华 张 156 Reputation points
3 answers One of the answers was accepted by the question author.

Can't run vstest

Hello all, I try to automate the UnitTests for our Azure Build Pipeline, but getting this error: Starting: Test run for Test plans ============================================================================== Task : Visual Studio…

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-11-30T10:32:36.047+00:00
Bernhard 111 Reputation points
answered 2022-12-01T13:06:03.117+00:00
Bernhard 111 Reputation points
1 answer

Unable to see Intellitest dropdown in Visual Studio 2022

TL&DR Running Visual Studio Enterprise 2022 for Windows 10 Home [See ScreenShot] Created Library for Dotnet 6 (ClassLibrary2) Created Library Test for Dotnet 6 (ClassLibrary2Tests) No Intellitest Drop Down Dear Internet, …

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,026 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-11-29T02:51:21.55+00:00
Vic Jay 1 Reputation point
answered 2022-11-29T06:44:32.123+00:00
Tianyu Sun-MSFT 30,236 Reputation points Microsoft Vendor
0 answers

UWP Unit Test can not connect to test process.

I have a UWP project LenovoVision that has two reference libraries CameraConfiguration and Lenovovision.Core. Now I create a UWP Unit Test project that references the above three projects. When I click Run All Tests under Test, the output…

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-11-21T05:38:26.557+00:00
华 张 156 Reputation points
commented 2022-11-25T04:20:21.927+00:00
华 张 156 Reputation points
1 answer

Net Core 6: Microsoft Fakes and WPF Issue

Hello, I hope I posted in the correct forum... I'm in the progress of migrating our WPF from .Net 4.7.2 to .Net Core 6 I run into issues with our test projects that reference WPF and use Microsoft Fakes Please see my demo repo here: …

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,755 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-08-23T15:47:50.847+00:00
Roy Rosenberg 1 Reputation point
answered 2022-11-18T22:35:55.253+00:00
Roy Rosenberg 1 Reputation point
1 answer

Query regarding App Centre Test Subscription

Does App Centre Test subscription ($99) includes build and distribute features as well ? Please clarify

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,515 questions
asked 2022-11-13T12:16:50.827+00:00
Nilesh G 1 Reputation point
answered 2022-11-14T09:58:05.367+00:00
Tianyu Sun-MSFT 30,236 Reputation points Microsoft Vendor
0 answers

Why Visual Studio 2022 Enterprise unit tests don't work in my new Windows 11 laptop?

Just creating an empty XUnit C# Unit test project fails miserably when trying to run or discover the tests with this error: Microsoft.TestPlatform.VsTestConsole.TranslationLayer.TransationLayerException: C:\Program Files\Microsoft Visual…

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-10-20T10:09:17.043+00:00
Carlos Colomina-Moreno 1 Reputation point
commented 2022-11-08T11:06:22.55+00:00
Carlos Colomina-Moreno 1 Reputation point
1 answer One of the answers was accepted by the question author.

Can't figure out why Assert.AreEqual fails

I have a simple code that finds repeating words in a string(the use of StringBuilder is required). It may be not the most officiant one and certainly not the cleanest, but it does the bare minimum. using System.Text.RegularExpressions; …

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-10-31T16:43:46.767+00:00
Lin 41 Reputation points
commented 2022-11-07T15:44:22.04+00:00
Lin 41 Reputation points
1 answer

MStest doesn't execute unit tests when OutputPath of the project changes

When I change the OutputPath for my unit test project the tests are still discoverable in Test Explorer, but when I try to run them (right-click -> Run) they don't run and I get the error below in Output window. Why it suddenly doesn't find that dll? …

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-11-05T00:27:59.567+00:00
Igor M 6 Reputation points
answered 2022-11-07T08:31:27.047+00:00
Anna Xiu-MSFT 28,491 Reputation points Microsoft Vendor
0 answers

I wanna open the freelauncher (from github) forms but i cant, how to fix it?

I wanna open the freelauncher (from github) forms. Exmp of error: in System.ComponentModel.TypeDescriptor.AddAttributes(Object instance, Attribute[] attributes) in Microsoft.VisualStudio.Design.VSDesignSurface.CreateDesigner(IComponent…

Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
986 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-11-01T19:02:34.403+00:00
lnrv 1 Reputation point
commented 2022-11-02T06:41:30.863+00:00
Anna Xiu-MSFT 28,491 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Can't figure out why my MSTest won't run

I have a simple program that uses List to store matrixes; this part is used to calculate a number of elements that are more then 3,15. It does what it needs to do but when it comes to testing i'm hit with endless loading with no errors showing. I'm…

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-10-25T17:36:33.373+00:00
Lin 41 Reputation points
accepted 2022-10-30T12:48:21.597+00:00
Lin 41 Reputation points
2 answers One of the answers was accepted by the question author.

Where can I find "Publish items"

Hello, I would like to ask why I do not see the option "Publish files" in the "Add project Output Group" selection. I am trying to make an application according to this video: …

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-07-01T08:16:40.057+00:00
Petr Novak 21 Reputation points
commented 2022-10-26T08:51:52.523+00:00
Bhuven Pillay 1 Reputation point
1 answer

Nunit not stop on break point

Hello everybody I'm going to try explain what it happen. I've one project on Net Core 6, its a library project. In this project I installed Nunit 3.13.3, NUnit3TestAdapter 4.2.1, Microsoft.NET.Test.Sdk 17.2.0, MSTest.TestAdapter…

Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
986 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-06-22T15:17:53.947+00:00
Tomas Garijo 6 Reputation points
commented 2022-10-26T00:47:57.253+00:00
Owen Mortensen 36 Reputation points
0 answers

Unit test: cannot delete a copied file

hi, I am writing an unit test to test a very simple application. The application is very simple. It only have two public APIs: OpenFile API: copy an existing binary file to a new created temp file and read it. CloseFile API: close both files…

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
asked 2022-10-20T21:09:28.203+00:00
Yu Hou 1 Reputation point
commented 2022-10-25T09:52:42.427+00:00
Tianyu Sun-MSFT 30,236 Reputation points Microsoft Vendor
1 answer

VS 2022 Shims, Stubs, Fakes fail to build

Just upgraded from VS 2012 Pro to VS 2022 Enterprise. Previously functioning Shims, Stubs and Accessors all fail to be created. ("not declared/defined")

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
345 questions
Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,031 questions
asked 2022-10-17T19:31:05.803+00:00
Robert Hull 6 Reputation points
commented 2022-10-19T13:52:18.287+00:00
Michael Taylor 53,396 Reputation points