public static DoesNotContain ( IEnumerable collection, Object actual ) : void | ||
collection | IEnumerable | IEnumerable of objects to be considered |
actual | Object | Object that cannot exist within collection |
return | void |
public void GetMovementsByDateRange_MustReturns_MovementsInRange() { Account account = new Account(); Expense ex1 = new Expense(1, new DateTime(2013, 1, 1)); // skip Expense ex2 = new Expense(1, new DateTime(2013, 1, 10)); // keep Expense ex3 = new Expense(1, new DateTime(2013, 1, 15)); // keep Expense ex4 = new Expense(1, new DateTime(2013, 2, 1)); // keep Expense ex5 = new Expense(1, new DateTime(2013, 2, 10)); // keep Expense ex6 = new Expense(1, new DateTime(2013, 2, 12)); // skip var from = new DateTime(2013, 1, 10); var to = new DateTime(2013, 2, 10); account.AddMovements(new List <IMovement>() { ex1, ex2, ex3, ex4, ex5, ex6 }); IEnumerable <IMovement> movements = account.GetMovementsByDateRange(from, to); CollectionAssert.Contains(movements, ex2); CollectionAssert.Contains(movements, ex3); CollectionAssert.Contains(movements, ex4); CollectionAssert.Contains(movements, ex5); CollectionAssert.DoesNotContain(movements, ex1); CollectionAssert.DoesNotContain(movements, ex6); }
public void TestEnabledNodes() { var shouldBeEnabled = new ValidEnabledStatePropertyNode(); var shouldNotBeEnabled = new DisabledStatePropertyNode(); NodeCollection initializedNodes = Node.InitializedNodes; NodeCollection enabledNodes = this.nodeSupervisor.FilterEnabledNodes(initializedNodes); CollectionAssert.Contains(enabledNodes, shouldBeEnabled); CollectionAssert.DoesNotContain(enabledNodes, shouldNotBeEnabled); }
public void GetMovementsByTag_MustReturns_TheTaggedMovements() { Account account = new Account(); Expense ex = new Expense(100, DateTime.Today, "mangiare"); Expense ex2 = new Expense(10, DateTime.Today, "cellulare"); Income income = new Income(1000, DateTime.Today, "stipendio"); Income income2 = new Income(25, DateTime.Today, "Cellulare"); account.AddExpense(ex); account.AddExpense(ex2); account.AddIncome(income); account.AddIncome(income2); IEnumerable <IMovement> movements = account.GetMovementByTag("Cellulare"); CollectionAssert.DoesNotContain(movements, ex); CollectionAssert.DoesNotContain(movements, income); CollectionAssert.Contains(movements, ex2); CollectionAssert.Contains(movements, income2); }