public void Create_Accumulate_AmountOfNOAndYESIsEqualToZERO() { var sut = new VotingByHandResultView(_votingByHands); Assert.AreEqual(6000, sut.StatementResults.Sum(s => s.AmtOfSharesYes)); Assert.AreEqual(0, sut.StatementResults.Sum(s => s.AmtOfSharesNo)); Assert.AreEqual(0, sut.StatementResults.Sum(s => s.AmtOfSharesOther)); }
public void Create_Accumulate_YesRateShouldEqualTo100() { var sut = new VotingByHandResultView(_votingByHands); //Assert.AreEqual(3000, sut.StatementResults.Sum(s=>s.AmtOfSharesYes)); Assert.AreEqual(100, sut.StatementResults.ElementAt(0).YesRate); Assert.AreEqual(0, sut.StatementResults.ElementAt(0).NoRate); Assert.AreEqual(0, sut.StatementResults.ElementAt(0).OtherRate); }
public void Create_Accumulate_AmountOfYESandNOIsNotEqualToZero() { foreach (var line in _votingByHands.ElementAt(0).VotingByHandLines) { line.VotingOption = VotingOption.No; } var sut = new VotingByHandResultView(_votingByHands); //Assert.AreEqual(3000, sut.StatementResults.Sum(s=>s.AmtOfSharesYes)); Assert.AreEqual(4000, sut.StatementResults.Sum(s => s.AmtOfSharesYes)); Assert.AreEqual(2000, sut.StatementResults.Sum(s => s.AmtOfSharesNo)); Assert.AreEqual(0, sut.StatementResults.Sum(s => s.AmtOfSharesOther)); }
public void Create_TotalNumberOfSharesShouldEqualTo3000() { var sut = new VotingByHandResultView(_votingByHands); Assert.AreEqual(3000, sut.TotalNumberOfShares); }
public void Create_StatementResultsCountShouldEqualToTwo() { var sut = new VotingByHandResultView(_votingByHands); Assert.AreEqual(2, sut.StatementResults.Count); }