public void EnsureBeheersingsNiveausExist_Should_Not_Save_Duplicate_Entity_In_Database() { // Arrange using var context = new CompetentieAppFrontendContext(_options); var repository = new BeheersingsNiveauRepository(context); // Act var result = repository.EnsureBeheersingsNiveausExist(new[] { new BeheersingsNiveau { ArchitectuurLaagId = 1, ActiviteitId = 5, Niveau = 3 }, }); // Assert Assert.IsTrue(result.Any(id => id.Equals(30))); }
public void EnsureBeheersingsNiveausExist_Should_Add_Items_That_Do_Not_Exist() { // Arrange using var context = new CompetentieAppFrontendContext(_options); var repository = new BeheersingsNiveauRepository(context); // Act var result = repository.EnsureBeheersingsNiveausExist(new[] { new BeheersingsNiveau { ArchitectuurLaagId = 1, ActiviteitId = 5, Niveau = 5 }, }); // Assert Assert.IsTrue(result.Any(id => id.Equals(31))); }
public void EnsureBeheersingsNiveausExist_Should_Return_Instance_of_Type_IEnumerable_With_Long() { // Arrange using var context = new CompetentieAppFrontendContext(_options); var repository = new BeheersingsNiveauRepository(context); // Act var result = repository.EnsureBeheersingsNiveausExist(new[] { new BeheersingsNiveau { ArchitectuurLaagId = 1, ActiviteitId = 5, Niveau = 3 }, }); // Assert Assert.IsInstanceOfType(result, typeof(IEnumerable <long>)); }