public void GetRole_WithData_valid() { // Mock var role = new Role { Id = Guid.NewGuid(), Name = "admin" }; _roleRepository.GetRole(Arg.Any <Guid>()).Returns(x => role); // Execute var result = _sut.GetRole(Guid.NewGuid()); // Assert Assert.NotNull(result); Assert.AreNotEqual(Guid.Empty, result.Id); Assert.AreEqual("admin", result.Name); }
public ApplicationRole Get(string id) { var role = _securityService.GetRole(id); return(role); }