Пример #1
0
        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);
        }
Пример #2
0
        public async Task <ApplicationRole> Post([FromBody] ApplicationRole role)
        {
            role = await _securityService.CreateRole(role);

            return(role);
        }