public virtual void CanUpdateApiResource() { using (var uow = DataService.StartUnitOfWork()) { var resource = new ApiResourceEntity { Name = "openid", Description = "OpenId-Scope", DisplayName = "OpenId", Enabled = true }; uow.ApiResourceRepository.Add(resource); var claim = new ApiResourceClaimEntity { ApiResourceId = resource.Id, ClaimType = "ClaimType" }; uow.ApiResourceClaimRepository.Add(claim); claim.ClaimType = "changed"; uow.ApiResourceClaimRepository.Update(claim); Assert.AreEqual(claim.ClaimType, uow.ApiResourceClaimRepository.Get(claim.Id).ClaimType); } }
public virtual void CanGetByApiIds() { using (var uow = DataService.StartUnitOfWork()) { var resource = new ApiResourceEntity { Name = "openid", Description = "OpenId-Scope", DisplayName = "OpenId", Enabled = true }; uow.ApiResourceRepository.Add(resource); var claim = new ApiResourceClaimEntity { ApiResourceId = resource.Id, ClaimType = "ClaimType" }; uow.ApiResourceClaimRepository.Add(claim); Assert.IsNotNull(uow.ApiResourceClaimRepository.GetByApiId(resource.Id).Single()); } }