Skip to content

Instantly share code, notes, and snippets.

@renatogroffe
Created November 13, 2024 16:35
Show Gist options
  • Save renatogroffe/b80e267143c4aa9d197f5bafbc09cc3b to your computer and use it in GitHub Desktop.
Save renatogroffe/b80e267143c4aa9d197f5bafbc09cc3b to your computer and use it in GitHub Desktop.
using System.Diagnostics;
using System.Runtime.InteropServices;
Console.WriteLine("***** Testes com .NET 9 | Melhorias em Debug.Assert *****");
Console.WriteLine($"Versao do .NET em uso: {RuntimeInformation
.FrameworkDescription} - Ambiente: {Environment.MachineName} - Kernel: {Environment
.OSVersion.VersionString}");
Console.WriteLine();
Console.WriteLine("Informe um numero inteiro positivo:");
var input = Console.ReadLine();
Debug.Assert(int.TryParse(input, out var number) && number > 0);
Console.WriteLine();
Console.WriteLine("Debug.Assert() nao produziu falha...");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment