public ClaimService(CarInsClaimsAppContext context, IUserService userService) { this.context = context ?? throw new ClaimException(ExceptionMessages.ContextIsNull); this.userService = userService ?? throw new ClaimException(ExceptionMessages.UserServiceIsNull); }
public async Task ThrowNullReferenceException_NegatuveClaimAmount() { string testClaimTitle = "Title"; string testDescription = "Description"; int testPolicyId = 11111; decimal testAmount = -3456; string testPersonalEmail = "*****@*****.**"; byte[] testPhoto = new byte[0]; var options = TestUtilities.GetOptions(nameof(ThrowNullReferenceException_NegatuveClaimAmount)); using (var assertContext = new CarInsClaimsAppContext(options)) { var sut = new ClaimService(assertContext, userService.Object); await sut.CreateClaim(testClaimTitle, testDescription, testPolicyId, testAmount, testPersonalEmail, testPhoto); } }
public UserService(CarInsClaimsAppContext context) { this.context = context ?? throw new ClaimException(ExceptionMessages.ContextIsNull); }