Skip to content

Instantly share code, notes, and snippets.

@munirwanis
munirwanis / ConsoleMenu
Created June 11, 2015 17:59
Menu em console application
#region Menu
public static void Menu(AuthenticateRequestDTO authRequest, AuthenticateResponseDTO authResponse)
{
var readKey = Console.ReadKey(false).GetHashCode() - 48; // -48 porque está em hashcode, e 1 em hash é 49, por exemplo.
Console.WriteLine("---- Main Menu ----\n");
switch (readKey)
{
case 1:
authResponse = AuthenticatePost(authRequest);
break;
@munirwanis
munirwanis / UsingTestMethods
Created June 11, 2015 17:53
Projeto de testes no VisualStudio
[TestClass]
public class UnitTest1 {
[TestMethod]
public void TestCalcSoma() {
int x = 10;
int y = 20;
int result;
Calc calc = new Calc();