public async void Name_Update_length()
        {
            Mock <IDeviceActionRepository> deviceActionRepository = new Mock <IDeviceActionRepository>();

            deviceActionRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new DeviceAction()));

            var validator = new ApiDeviceActionRequestModelValidator(deviceActionRepository.Object);
            await validator.ValidateUpdateAsync(default(int), new ApiDeviceActionRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.Name, new string('A', 91));
        }
        public async void Name_Create_null()
        {
            Mock <IDeviceActionRepository> deviceActionRepository = new Mock <IDeviceActionRepository>();

            deviceActionRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new DeviceAction()));

            var validator = new ApiDeviceActionRequestModelValidator(deviceActionRepository.Object);
            await validator.ValidateCreateAsync(new ApiDeviceActionRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.Name, null as string);
        }
        public async void DeviceId_Update_Valid_Reference()
        {
            Mock <IDeviceActionRepository> deviceActionRepository = new Mock <IDeviceActionRepository>();

            deviceActionRepository.Setup(x => x.GetDevice(It.IsAny <int>())).Returns(Task.FromResult <Device>(new Device()));

            var validator = new ApiDeviceActionRequestModelValidator(deviceActionRepository.Object);
            await validator.ValidateUpdateAsync(default(int), new ApiDeviceActionRequestModel());

            validator.ShouldNotHaveValidationErrorFor(x => x.DeviceId, 1);
        }
        public async void DeviceId_Create_Invalid_Reference()
        {
            Mock <IDeviceActionRepository> deviceActionRepository = new Mock <IDeviceActionRepository>();

            deviceActionRepository.Setup(x => x.DeviceByDeviceId(It.IsAny <int>())).Returns(Task.FromResult <Device>(null));

            var validator = new ApiDeviceActionRequestModelValidator(deviceActionRepository.Object);

            await validator.ValidateCreateAsync(new ApiDeviceActionRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.DeviceId, 1);
        }