public async void UserId_Update_Valid_Reference() { Mock <IAdminRepository> adminRepository = new Mock <IAdminRepository>(); adminRepository.Setup(x => x.UserByUserId(It.IsAny <int>())).Returns(Task.FromResult <User>(new User())); var validator = new ApiAdminRequestModelValidator(adminRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiAdminRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.UserId, 1); }
public async void StudioId_Create_Valid_Reference() { Mock <IAdminRepository> adminRepository = new Mock <IAdminRepository>(); adminRepository.Setup(x => x.GetStudio(It.IsAny <int>())).Returns(Task.FromResult <Studio>(new Studio())); var validator = new ApiAdminRequestModelValidator(adminRepository.Object); await validator.ValidateCreateAsync(new ApiAdminRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.StudioId, 1); }