public void Should_CallCommit() { // Arrange var addService = new AddsServices(this.repoMocked.Object, this.unitOfWorkMocked.Object); // Act addService.CreateAdd("1234", 1, 1, 1, "iphone", "somewhere"); // Assert this.unitOfWorkMocked.Verify(x => x.Commit(), Times.Once); }
public void Call_AllMethodFromRepositoryOnce() { // Arrange var addService = new AddsServices(this.repoMocked.Object, this.unitOfWorkMocked.Object); // Act addService.CreateAdd("1234", 1, 1, 1, "iphone", "somewhere"); // Assert this.repoMocked.Verify(x => x.Add(It.IsAny <Add>()), Times.Once); }
public void ShouldCreateAdd_WhenValidParameters() { // Arrange var addService = new AddsServices(this.repoMocked.Object, this.unitOfWorkMocked.Object); //act addService.CreateAdd("1234", 1, 1, 1, "iphone", "somewhere"); //assert Assert.AreEqual(5, this.adds.Count() + 1); }