Ejemplo n.º 1
0
        public void Repo_Roles_GetV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateRoles();

            var results = UoW.Roles.Get();

            results.Should().BeAssignableTo <IEnumerable <tbl_Role> >();
            results.Count().Should().Be(UoW.Roles.Count());
        }
Ejemplo n.º 2
0
        public void Repo_Roles_DeleteV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateRoles();

            var role = UoW.Roles.Get(QueryExpressionFactory.GetQueryExpression <tbl_Role>()
                                     .Where(x => x.Name == TestDefaultConstants.RoleName).ToLambda())
                       .Single();

            UoW.Roles.Delete(role);
            UoW.Commit();
        }
Ejemplo n.º 3
0
        public void Repo_Roles_UpdateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateRoles();

            var role = UoW.Roles.Get(QueryExpressionFactory.GetQueryExpression <tbl_Role>()
                                     .Where(x => x.Name == TestDefaultConstants.RoleName).ToLambda())
                       .Single();

            role.Name += "(Updated)";

            var result = UoW.Roles.Update(role);

            UoW.Commit();

            result.Should().BeAssignableTo <tbl_Role>();
        }
Ejemplo n.º 4
0
        public void Repo_Roles_CreateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateRoles();

            var audience = UoW.Audiences.Get(QueryExpressionFactory.GetQueryExpression <tbl_Audience>()
                                             .Where(x => x.Name == TestDefaultConstants.AudienceName).ToLambda())
                           .Single();

            var result = UoW.Roles.Create(
                Mapper.Map <tbl_Role>(new RoleV1()
            {
                AudienceId  = audience.Id,
                Name        = TestDefaultConstants.RoleName,
                IsEnabled   = true,
                IsDeletable = false,
            }));

            UoW.Commit();

            result.Should().BeAssignableTo <tbl_Role>();
        }