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…
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…
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…
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…
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…
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?
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…
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, …
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…
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: …
Query regarding App Centre Test Subscription
Does App Centre Test subscription ($99) includes build and distribute features as well ? Please clarify
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…
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; …
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? …
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…
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…
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: …
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…
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…
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")