This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void SendToBranchWhenIsValidException() | |
| { | |
| //Arrange | |
| Mock<IValidator> mockValidator | |
| = new Mock<IValidator>(); | |
| mockValidator.Setup(x => x.ServiceStatus).Returns(Status.NotOK); | |
| mockValidator.Setup(x => x.IsValid(It.IsAny<string>())) | |
| .Throws(new Exception("Some exception Message")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void StatusShouldBeSame() | |
| { | |
| //Arrange | |
| var mockValidator = new Mock<IValidator>(); | |
| mockValidator.SetupAllProperties(); | |
| mockValidator.Setup(x => x.Customer.IsValid).Returns(true); | |
| var sut = new CreditApplicationEvaluator(mockValidator.Object); | |
| var application = new CreditApplication { Age = 30 }; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void ProductRatingShouldNotNull() | |
| { | |
| //Arrange | |
| var dbServiceMock = new Mock<IDbService>(); | |
| dbServiceMock.Setup(x => x.GetRatingDataAsync(It.IsAny<object>())) | |
| .ReturnsAsync(() => {return List<RatingDto>();}); | |
| var creditCardServices = new creditCardServices(dbServiceMock); | |
| //Act | |
| var sut = creditCardServices.GetProductAverageRating(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void ProductRatingShouldNotNull() | |
| { | |
| //Arrange | |
| var dbServiceMock = new Mock<IDbService>(); | |
| dbServiceMock.Setup(x => x.GetRatingDataAsync(It.IsAny<object>())) | |
| .Returns(Task.FromResult(List<RatingDto>())); | |
| var creditCardServices = new creditCardServices(dbServiceMock); | |
| //Act |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void KeywordReportShouldTriggerEmail() | |
| { | |
| //Arrange | |
| var emailMock = new Mock<IEmailServices>(); | |
| emailMock.Setup(x => x.Send(It.IsAny<object>)).Returns(true); | |
| AdwordsServices service = new AdwordsServices(_emailServices); | |
| var date = DateTime.Today.AddDays(-3).ToString("yyyyMMdd"); | |
| //Act | |
| var list = service.KeywordReport(date); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void CustomerCheckShouldUpdateIsAppliedProperty() | |
| { | |
| //Arrange | |
| var mockValidator = new Mock<IValidator>(); | |
| mockValidator.Setup(x => x.Customer.IsValid).Returns(true); | |
| var sut = new CreditApplicationEvaluator(mockValidator.Object); | |
| var application = new CreditApplication { GrossAnnualIncome = 99_000 }; | |
| //Act |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void CustomerCheckShouldCallIsValidGetter() | |
| { | |
| //Arrange | |
| var mockValidator = new Mock<IValidator>(); | |
| mockValidator.Setup(x => x.Customer.IsValid).Returns(true); | |
| var sut = new CreditApplicationEvaluator(mockValidator.Object); | |
| var application = new CreditApplication { GrossAnnualIncome = 99_000 }; | |
| //Act |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void GaDataProcessShouldNotSaveAsStructured() | |
| { | |
| //Arrange | |
| var gadbServicesMock = new Mock<IGaDbServices>(); | |
| var service = new GoogleAnalyticsServices(gadbServicesMock); | |
| var date = DateTime.Today.AddDays(-2); | |
| //Act | |
| var list = service.GaDataProcess("",date,date.AddDays(1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void GaDataProcessShouldSaveAsUnstructured() | |
| { | |
| //Arrange | |
| var gadbServicesMock = new Mock<IGaDbServices>(); | |
| var service = new GoogleAnalyticsServices(gadbServicesMock); | |
| var date = DateTime.Today.AddDays(-2); | |
| //Act | |
| var list = service.GaDataProcess("",date,date.AddDays(1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void ReferInvalidApplications() | |
| { | |
| Mock<IFrequentFlyerNumberValidator> mockValidator = | |
| new Mock<IFrequentFlyerNumberValidator>(MockBehavior.Strict); | |
| //mockValidator.Setup(x => x.IsValid(It.IsAny<string>())).Returns(false); | |
| var sut = new CreditApplicationEvaluator(mockValidator.Object); |