public void CreateRoles_Always_valid() { // Mock var roleModel = new Role() { Name = "admin", }; // execute _sut.CreateRole(roleModel); // Assert Assert.IsNotNull(roleModel); Assert.AreNotEqual(Guid.Empty, roleModel.Id); Assert.IsTrue(roleModel.IsActive); Assert.AreEqual("admin", roleModel.Name); Assert.IsNull(roleModel.UpdateTime); }
public async Task <ApplicationRole> Post([FromBody] ApplicationRole role) { role = await _securityService.CreateRole(role); return(role); }