public void and_an_id_property_is_found_of_type_long_then_the_next_increment_long_value_should_be_returned(long? currentMaxId, long expectedId) { // Arrange // Act var nextId = new SmartNextIdRetreiver().GetNextId(typeof(BlogWithIdWithLongType), () => currentMaxId); //Assert Assert.AreEqual(expectedId, nextId); }
public void and_an_id_property_cannot_be_found_then_a_null_should_be_returned() { // Arrange // Act var nextId = new SmartNextIdRetreiver().GetNextId(typeof(BlogWithNoPropertyId), () => 1); // Assert Assert.IsNull(nextId); }
public void and_an_id_property_is_found_of_type_guid_then_the_next_guid_value_should_be_returned(bool isCurrentIdNull) { // Arrange var currentMaxId = isCurrentIdNull ? null as Guid? : Guid.NewGuid(); // Act var nextId = new SmartNextIdRetreiver().GetNextId(typeof(BlogWithIdWithGuidType), () => currentMaxId); //Assert Assert.IsNotNull(nextId); Assert.AreNotEqual(currentMaxId, nextId); }