public void AreEqual_ForNonEqualValues_ThrowsAssertionException() { string firstNameColumn = "firstName"; string firstName = "Barack"; SetUpAreEqualTest(firstNameColumn, "SomeOtherFirstName"); DbAssert.ForTable("Person").WithColumnValuePair("x", "y").AreEqual(firstNameColumn, firstName); }
public void NotExists_ForExistingValue_ThrowsAssertionException() { string columnName = "Surname"; string columnValue = "Obama"; SetUpExistsTest(1); DbAssert.ForTable("Person").WithColumnValuePair(columnName, columnValue).NotExists(); }
public void AreEqual_ForEqualValues_NothingHappens() { string firstNameColumn = "firstName"; string firstName = "Barack"; SetUpAreEqualTest(firstNameColumn, firstName); DbAssert.ForTable("Person").WithColumnValuePair("x", "y").AreEqual(firstNameColumn, firstName); }
public void NotExists_ForNonExistingValue_NothingHappens() { string columnName = "Surname"; string columnValue = "Obama"; SetUpExistsTest(0); DbAssert.ForTable("Person").WithColumnValuePair(columnName, columnValue).NotExists(); }
public void AreEqual_ShouldBeAble_NoExceptionThrown() { string lastName = "Bulgakov"; string firstName = "Mikhail"; int id = InsertPerson(lastName, firstName); DbAssert.ForTable("Person") .WithColumnValuePair("IdPerson", id) .AreEqual("LastName", lastName); }
public void NotExists_ExistsInDatabase_ThrowsAssertionException() { string lastName = "Bulgakov"; string firstName = "Mikhail"; int id = InsertPerson(lastName, firstName); DbAssert.ForTable("Person") .WithColumnValuePair("IdPerson", id) .NotExists(); }
public void Exists_ExistsInDatabase_NoExceptionThrown() { string lastName = "Stoltenberg"; string firstName = "Jens"; int id = InsertPerson(lastName, firstName); DbAssert.ForTable("Person") .WithColumnValuePair("IdPerson", id) .Exists(); }
public void IncRowVersion_HappyDays_IncreasesVersionInDatabase() { int id = NextId(); int rowVersion = 1; DataBoy.ForTable("Person") .Row("IdPerson", id) .D("FirstName", "Petter") .D("LastName", "Hansen") .D("Version", rowVersion) .Commit(); Adversary.ForTable("Person").IdentifiedBy("IdPerson", id).IncRowVersion("Version"); DbAssert.ForTable("Person").WithColumnValuePair("IdPerson", id).AreEqual("Version", rowVersion + 1); }
public void Evaluate_IsTrue_NothingHappens() { SetUpEvaluateTest(); DbAssert.ForTable("Person").WithColumnValuePair("x", "y").Evaluate(x => true); }
public void Evaluate_IsFalse_ThrowsAssertionException() { SetUpEvaluateTest(); DbAssert.ForTable("Person").WithColumnValuePair("x", "y").Evaluate(x => false); }
public void NotExists_DoesNotExistInDatabase_NoExceptionThrown() { DbAssert.ForTable("Person") .WithColumnValuePair("IdPerson", NextId()) .NotExists(); }
public void Exists_DoesNotExistInDatabase_ThrowsAssertionException() { DbAssert.ForTable("Person") .WithColumnValuePair("IdPerson", 12) .Exists(); }