public void Save() { var mockLetterTemplateLogic = new Mock <ILetterTemplateRepository>(); const long result = 12; mockLetterTemplateLogic.Setup(f => f.Save(It.IsAny <LetterTemplate>())).Returns(result); LetterTemplateLogic target = new LetterTemplateLogic(mockLetterTemplateLogic.Object); long actual = target.Save(new LetterTemplate()); Assert.AreEqual(result, actual); }
public void AddEditLetterTemplate() { // Arrange var mockLetterTemplateRepository = new Mock <ILetterTemplateRepository>(); const long result = 2; mockLetterTemplateRepository.Setup(f => f.Save(It.IsAny <LetterTemplate>())).Returns(result); LetterTemplateLogic target = new LetterTemplateLogic(mockLetterTemplateRepository.Object); // Act long actual = target.Save(null); // Assert Assert.AreEqual(result, actual); }
/// <summary> /// Adds the edit letter template. /// </summary> /// <param name="letterTemplate">The letter template.</param> /// <returns></returns> public long Save(LetterTemplate letterTemplate) { return(_letterTemplateLogic.Save(letterTemplate)); }