public void ShouldCreateGenderType() { // Arrange GenderTypeRepository repository = new GenderTypeRepository(ConfigSettings.MySqlDatabaseConnectionName); GenderTypeEntity entity = GenderTypeData.GetItemForInsert(); repository.ClearCollection(); // Act entity = repository.Create(entity); // Assert Assert.IsNotNull(entity); Assert.AreNotEqual(0, entity.Id); }
public void ShouldCreateGenderTypes() { // Arrange GenderTypeRepository repository = new GenderTypeRepository(ConfigSettings.MySqlDatabaseConnectionName); List<GenderTypeEntity> entities = GenderTypeData.GetItemsForInsert(); repository.ClearCollection(); // Act entities = repository.Create(entities); // Assert Assert.IsNotNull(entities); Assert.AreEqual(2, entities.Count); }
public void ShouldReadGenderTypeWithId() { // Arrange GenderTypeRepository repository = new GenderTypeRepository(ConfigSettings.MySqlDatabaseConnectionName); GenderTypeEntity entity = GenderTypeData.GetItemForInsert(); repository.ClearCollection(); // Act entity = repository.Create(entity); // Act var actual = repository.Read(entity.Id); // Assert Assert.AreEqual(entity.Description, actual.Description); }
public void ShouldUpdateGenderType() { // Arrange GenderTypeRepository repository = new GenderTypeRepository(ConfigSettings.MySqlDatabaseConnectionName); GenderTypeEntity entity = GenderTypeData.GetItemForInsert(); repository.ClearCollection(); entity = repository.Create(entity); entity.Description = "Male"; // Act GenderTypeEntity actual = repository.Update(entity); // Assert Assert.AreEqual(entity.Description, actual.Description); }
private static void CreateGenderTypes() { GenderTypeRepository repository = new GenderTypeRepository(ConfigSettings.MySqlDatabaseConnectionName); GenderTypeEntity entity = new GenderTypeEntity() { Description = "Manlijk", DeletedDate = DateTime.MinValue }; GenderTypeEntity mEntity = new GenderTypeEntity() { Description = "Vrouwlijk", DeletedDate = DateTime.MinValue }; entity = repository.Create(entity); mEntity = repository.Create(mEntity); _genderTypeEntities.Add(entity); _genderTypeEntities.Add(mEntity); }