Created
July 30, 2014 00:06
-
-
Save marcioalthmann/2bc1c5d23123c5cdd765 to your computer and use it in GitHub Desktop.
select-sum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test()] | |
public void Somando_mais_de_uma_propriedade_com_select_mais_sum() | |
{ | |
var lista = new List<Objeto> (); | |
lista.Add (new Objeto{ PrimeiroValor = 10, SegundoValor = 20 }); | |
lista.Add (new Objeto{ PrimeiroValor = 30, SegundoValor = 40 }); | |
Assert.AreEqual(100, lista.Select(x => x.PrimeiroValor + x.SegundoValor).Sum()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment