public void Create_EmptySignature_Exception() { var newSignature = new DataPlus.Entities.Models.Signature(); var repositoryWrapper = new Mock <IWrapperRepository>(); var signatureService = new SignatureService(repositoryWrapper.Object, _logger); Assert.Throws <NullReferenceException>(() => signatureService.Create(newSignature)); }
public void Create_SignatureWithData_NewSignature() { var newSignature = new DataPlus.Entities.Models.Signature { Id = Guid.NewGuid(), Name = "Signature 6", Description = "Signature 6 Description" }; var repositoryWrapper = new Mock <IWrapperRepository>(); repositoryWrapper.Setup(x => x.Signature.GetAll()).Returns(_signatureList.AsQueryable); var signatureService = new SignatureService(repositoryWrapper.Object, _logger); var numberOfSignatures = signatureService.GetAll().Count; signatureService.Create(newSignature); }