public void Repo_Roles_GetV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateRoles(); var results = UoW.Roles.Get(); results.Should().BeAssignableTo <IEnumerable <uvw_Role> >(); results.Count().Should().Be(UoW.Roles.Count()); }
public void Repo_Roles_DeleteV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateRoles(); var role = UoW.Roles.Get(QueryExpressionFactory.GetQueryExpression <uvw_Role>() .Where(x => x.Name == TestDefaultConstants.RoleName).ToLambda()) .Single(); UoW.Roles.Delete(role); UoW.Commit(); }
public void Repo_Roles_UpdateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateRoles(); var role = UoW.Roles.Get(QueryExpressionFactory.GetQueryExpression <uvw_Role>() .Where(x => x.Name == TestDefaultConstants.RoleName).ToLambda()) .Single(); role.Name += "(Updated)"; var result = UoW.Roles.Update(role); UoW.Commit(); result.Should().BeAssignableTo <uvw_Role>(); }
public void Repo_Roles_CreateV1_Success() { var data = new TestDataFactory(UoW); data.Destroy(); data.CreateRoles(); var audience = UoW.Audiences.Get(QueryExpressionFactory.GetQueryExpression <uvw_Audience>() .Where(x => x.Name == TestDefaultConstants.AudienceName).ToLambda()) .Single(); var result = UoW.Roles.Create( Mapper.Map <uvw_Role>(new RoleV1() { AudienceId = audience.Id, Name = TestDefaultConstants.RoleName, IsEnabled = true, IsDeletable = false, })); UoW.Commit(); result.Should().BeAssignableTo <uvw_Role>(); }