Пример #1
0
        public void ConvertToRole_should_throw_argument_null_exception_when_input_is_null()
        {
            //arrange
            RoleDTO inputRoleDTO = null;

            //act
            var exception = Assert.Throws <ArgumentNullException>(() =>
                                                                  RoleMapper.ConvertToRole(inputRoleDTO));
        }
Пример #2
0
        public void ConvertToRole_should_map_RoleDTO_to_Role()
        {
            //arrange
            RoleDTO inputRoleDTO = new RoleDTO
            {
                Id   = 1,
                Name = "DefaultRole"
            };

            //act
            var resultRole = RoleMapper.ConvertToRole(inputRoleDTO);

            //assert
            Assert.Equal(inputRoleDTO.Id, resultRole.Id);
            Assert.Equal(inputRoleDTO.Name, resultRole.Name);
        }