Ejemplo n.º 1
0
        public void DeleteAsync_Should_Not_Throw_Exception()
        {
            const string id = "123";
            //arrange
            var mockedRepo       = new Mock <IGenericRepository <SubmissionVM> >();
            var mockedConfigRepo = new Mock <IGenericRepository <ConfigVM> >();
            var mockedConfig     = new Mock <IAppConfiguration <ConfigVM> >();
            var sut = new SubmissionService(mockedRepo.Object, mockedConfigRepo.Object, mockedConfig.Object);

            mockedRepo.Setup(x => x.DeleteAsync(It.IsAny <string>()));
            // Act
            Action action = () => sut.DeleteAsync(id);

            // Assert
            action.Should().NotThrow <Exception>();
        }
Ejemplo n.º 2
0
        public void DeleteAsync_Should_Not_Throw_Exception()
        {
            const string id = "123";
            //arrange
            var mockedRepo = new Mock <IGenericRepository <SubmissionVM> >();
            var mockedServiceBusService = new Mock <IServiceBusService>();
            var mockedJobClient         = new Mock <IBackgroundJobClient>();
            var mockedConfigRepo        = new Mock <IGenericRepository <ConfigVM> >();
            var mockedConfig            = new Mock <IAppConfiguration <ConfigVM> >();
            var mockedAppSettings       = new Mock <IConfiguration>();
            //var mockedIdGenerator = new Mock<IUidGeneratorService>();
            var sut = new SubmissionService(mockedRepo.Object, mockedServiceBusService.Object, mockedJobClient.Object);     //, mockedConfigRepo.Object, mockedConfig.Object, mockedAppSettings.Object);

            mockedRepo.Setup(x => x.DeleteAsync(It.IsAny <string>()));
            // Act
            Action action = () => sut.DeleteAsync(id);

            // Assert
            action.Should().NotThrow <Exception>();
        }