public async void Name_Update_length()
        {
            Mock <IMachineRepository> machineRepository = new Mock <IMachineRepository>();

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

            var validator = new ApiMachineRequestModelValidator(machineRepository.Object);
            await validator.ValidateUpdateAsync(default(int), new ApiMachineRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.Name, new string('A', 129));
        }
        private async void BeUniqueByMachineGuid_Update_Not_Exists()
        {
            Mock <IMachineRepository> machineRepository = new Mock <IMachineRepository>();

            machineRepository.Setup(x => x.ByMachineGuid(It.IsAny <Guid>())).Returns(Task.FromResult <Machine>(null));
            var validator = new ApiMachineRequestModelValidator(machineRepository.Object);

            await validator.ValidateUpdateAsync(default(int), new ApiMachineRequestModel());

            validator.ShouldNotHaveValidationErrorFor(x => x.MachineGuid, Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
        }
        public async void Description_Update_null()
        {
            Mock <IMachineRepository> machineRepository = new Mock <IMachineRepository>();

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

            var validator = new ApiMachineRequestModelValidator(machineRepository.Object);
            await validator.ValidateUpdateAsync(default(int), new ApiMachineRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.Description, null as string);
        }
        private async void BeUniqueByName_Update_Not_Exists()
        {
            Mock <IMachineRepository> machineRepository = new Mock <IMachineRepository>();

            machineRepository.Setup(x => x.ByName(It.IsAny <string>())).Returns(Task.FromResult <Machine>(null));
            var validator = new ApiMachineRequestModelValidator(machineRepository.Object);

            await validator.ValidateUpdateAsync(default(string), new ApiMachineRequestModel());

            validator.ShouldNotHaveValidationErrorFor(x => x.Name, "A");
        }