Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }