Make sure you have all the below NuGet packages added in your test project. So that all test methods will be displayed in Test Explorer window.
- xunit
- xunit.runner.visualstudio
- Microsoft.NET.Test.Sdk
Make sure you have all the below NuGet packages added in your test project. So that all test methods will be displayed in Test Explorer window.
using System;
public class HelloWorld { public static void Main(string[] args) { DateTime birthdate = DateTime.ParseExact("1989-02-25", "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture); var today = DateTime.Today; var age = today.Year - birthdate.Year; today.AddYears(-age); Console.WriteLine (age); } }
string codeBase = Assembly.GetExecutingAssembly().CodeBase; UriBuilder uri = new UriBuilder(codeBase); string path = Uri.UnescapeDataString(uri.Path); var assemblyPath = Path.GetDirectoryName(path);