public void CostructorWithCollectionEqualIdShouldInvalidOperationExceptionWhit() { ICollection <IPerson> people = new List <IPerson>(); for (int i = 0; i < 20; i++) { FakeFirstPerson fakeFirstPerson = new FakeFirstPerson(3 + i, (string.Concat("Gosho"), 5).ToString()); people.Add(fakeFirstPerson); } Assert.Throws <InvalidOperationException>(() => database = new Database(people.ToArray())); }
public void AddWhitVeryElementsShouldInvalidOperationExceptionWhit() { for (int i = 0; i < 15; i++) { FakeFirstPerson fakeFirstPerson = new FakeFirstPerson(3 + i, (string.Concat("Gosho"), i).ToString()); if (i == 14) { Assert.Throws <InvalidOperationException>(() => database.Add(fakeFirstPerson)); } else { database.Add(fakeFirstPerson); } } }
public void ChecksForTheExistenceWithIncorectlyId() { var fakePerson = new FakeFirstPerson(1, "Pesho"); bool isPossible = database.ChecksForTheExistenceOfThisPerson(fakePerson); Assert.AreEqual(false, database.ChecksForTheExistenceOfThisPerson(fakePerson)); }
public void ChecksForTheExistenceWithCorrectlyId() { var fakePerson = new FakeFirstPerson(3, "Gosho"); bool isPossible = database.ChecksForTheExistenceOfThisPerson(fakePerson); Assert.AreEqual(true, database.ChecksForTheExistenceOfThisPerson(fakePerson)); }
public void AddShouldCorrectly() { FakeFirstPerson fakeFirstPerson = new FakeFirstPerson(5, "Gosho"); database.Add(fakeFirstPerson); IPerson person = database.DatabaseElements[2]; Assert.AreEqual(fakeFirstPerson.Id, person.Id); Assert.AreEqual(fakeFirstPerson.Name, person.Name); }
public void CostructorWithCollectionWhitEqalNameShouldInvalidOperationExceptionWhit() { ICollection <IPerson> people = new List <IPerson>(); for (int i = 0; i < 2; i++) { FakeFirstPerson fakeFirstPerson = new FakeFirstPerson(3 + i, "Gosho"); people.Add(fakeFirstPerson); } Assert.Throws <InvalidOperationException>(() => database = new Database(people.ToArray())); }
public void AddWhitIncorectIdElementsShouldInvalidOperationExceptionWhit() { FakeFirstPerson person = new FakeFirstPerson(1, "Ana"); Assert.Throws <InvalidOperationException>(() => database.Add(person)); }