public void ShouldThowUserExceptionOnUpdate() { using (var executionContext = new CommonTestExecutionContext()) { var repository = new Common.DomRepository(executionContext); var entity = new SimpleMinLength { StringMoreThan2Chars = "." }; repository.TestLengthLimit.SimpleMinLength.Update(new[] { entity }); } }
public void ShouldThowUserExceptionOnInsert() { using (var container = new RhetosTestContainer()) { var repository = container.Resolve<Common.DomRepository>(); var entity = new SimpleMinLength { StringMoreThan2Chars = "." }; repository.TestLengthLimit.SimpleMinLength.Insert(new[] { entity }); } }
public void ShouldNotThrowUserExceptionOnInsert() { using (var container = new RhetosTestContainer()) { var repository = container.Resolve <Common.DomRepository>(); var entity = new SimpleMinLength { StringMoreThan2Chars = ".aaa" }; repository.TestLengthLimit.SimpleMinLength.Insert(new[] { entity }); } }
public void ShouldNotThrowUserExceptionOnInsert() { using (var scope = TestScope.Create()) { var repository = scope.Resolve <Common.DomRepository>(); var entity = new SimpleMinLength { StringMoreThan2Chars = ".aaa" }; repository.TestLengthLimit.SimpleMinLength.Insert(new[] { entity }); } }
public void ShouldThowUserExceptionOnInsert() { using (var container = new RhetosTestContainer()) { var repository = container.Resolve<Common.DomRepository>(); var entity = new SimpleMinLength { StringMoreThan2Chars = "." }; TestUtility.ShouldFail<Rhetos.UserException>( () => repository.TestLengthLimit.SimpleMinLength.Insert(entity), "StringMoreThan2Chars", "minimum", "3"); } }
public void ShouldInsertEntity() { using (var container = new RhetosTestContainer()) { container.Resolve<ISqlExecuter>().ExecuteSql(new[] { "DELETE FROM TestLengthLimit.SimpleMaxLength;", }); var repository = container.Resolve<Common.DomRepository>(); var entity = new SimpleMinLength { StringMoreThan2Chars = "abc" }; repository.TestLengthLimit.SimpleMinLength.Insert(new[] { entity }); } }
public void ShouldInsertEntity() { using (var executionContext = new CommonTestExecutionContext()) { executionContext.SqlExecuter.ExecuteSql(new[] { "DELETE FROM TestLengthLimit.SimpleMaxLength;", }); var repository = new Common.DomRepository(executionContext); var entity = new SimpleMinLength { StringMoreThan2Chars = "abc" }; repository.TestLengthLimit.SimpleMinLength.Insert(new[] { entity }); } }
public void ShouldThowUserExceptionOnInsert() { using (var container = new RhetosTestContainer()) { var repository = container.Resolve <Common.DomRepository>(); var entity = new SimpleMinLength { StringMoreThan2Chars = "." }; TestUtility.ShouldFail <Rhetos.UserException>( () => repository.TestLengthLimit.SimpleMinLength.Insert(entity), "StringMoreThan2Chars", "minimum", "3"); } }
public void ShouldInsertEntity() { using (var container = new RhetosTestContainer()) { container.Resolve <ISqlExecuter>().ExecuteSql(new[] { "DELETE FROM TestLengthLimit.SimpleMaxLength;", }); var repository = container.Resolve <Common.DomRepository>(); var entity = new SimpleMinLength { StringMoreThan2Chars = "abc" }; repository.TestLengthLimit.SimpleMinLength.Insert(new[] { entity }); } }
public void ShouldThowUserExceptionOnUpdate() { using (var scope = TestScope.Create()) { var repository = scope.Resolve <Common.DomRepository>(); var entity = new SimpleMinLength { StringMoreThan2Chars = "1234" }; repository.TestLengthLimit.SimpleMinLength.Insert(entity); entity.StringMoreThan2Chars = "1"; TestUtility.ShouldFail <Rhetos.UserException>( () => repository.TestLengthLimit.SimpleMinLength.Update(entity), "StringMoreThan2Chars", "minimum", "3"); } }
public void ShouldInsertEntity() { using (var scope = TestScope.Create()) { scope.Resolve <ISqlExecuter>().ExecuteSql(new[] { "DELETE FROM TestLengthLimit.SimpleMaxLength;", }); var repository = scope.Resolve <Common.DomRepository>(); var entity = new SimpleMinLength { StringMoreThan2Chars = "abc" }; repository.TestLengthLimit.SimpleMinLength.Insert(new[] { entity }); } }