Skip to content

Instantly share code, notes, and snippets.

@marcioalthmann
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcioalthmann/8c2855fb87802f7db14f to your computer and use it in GitHub Desktop.
Save marcioalthmann/8c2855fb87802f7db14f to your computer and use it in GitHub Desktop.
Objeto
public class Objeto
{
public int PrimeiroValor { get;set;}
public int SegundoValor { get;set;}
}
[TestFixture ()]
public class Test
{
[Test ()]
public void Somando_uma_propriedade ()
{
var lista = new List<Objeto> ();
lista.Add (new Objeto{ PrimeiroValor = 10, SegundoValor = 20 });
lista.Add (new Objeto{ PrimeiroValor = 30, SegundoValor = 40 });
Assert.AreEqual (40, lista.Sum (x => x.PrimeiroValor));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment