Beispiel #1
0
        public async Task ValidateFind_Ok()
        {
            var testEntities = TestEntitiesData.TestEntities;
            var id           = testEntities.First().Id;
            var testIncludeValidateService = TestIncludeValidateServiceMock.GetTestIncludeValidateService();
            var dbSetTest           = TestDatabaseSetMock.GetDbSetTest(testEntities);
            var testTable           = new TestTable(dbSetTest.Object);
            var testValidateService = new TestDatabaseValidateService(testTable, testIncludeValidateService.Object);

            var result = await testValidateService.ValidateFind(id);

            Assert.True(result.OkStatus);
        }
Beispiel #2
0
        public async Task ValidateFind_NotFound()
        {
            var testEntities = Enumerable.Empty <TestEntity>();
            var id           = TestEntitiesData.TestEntities.First().Id;
            var testIncludeValidateService = TestIncludeValidateServiceMock.GetTestIncludeValidateService();
            var dbSetTest           = TestDatabaseSetMock.GetDbSetTest(testEntities);
            var testTable           = new TestTable(dbSetTest.Object);
            var testValidateService = new TestDatabaseValidateService(testTable, testIncludeValidateService.Object);

            var result = await testValidateService.ValidateFind(id);

            Assert.True(result.HasErrors);
            Assert.True(result.Errors.First().ErrorResultType == ErrorResultType.ValueNotFound);
        }