コード例 #1
0
        public void Execute_Should_Throw_ArgumentNullException_When_Parameters_IsNull()
        {
            // Arrange
            var JSONExportEmployeesMock = new JSONExportEmployees(this.dbStub, this.serializerStub.Object, this.exporterStub.Object, this.writerStub.Object);

            // Act && Assert
            Assert.ThrowsException <ArgumentNullException>(() => JSONExportEmployeesMock.Execute(null));
        }
コード例 #2
0
        public void Execute_Should_Throw_ArgumentNullException_When_ParameterCount_IsNotValid()
        {
            // Arrange
            var JSONExportEmployeesMock = new JSONExportEmployees(this.dbStub, this.serializerStub.Object, this.exporterStub.Object, this.writerStub.Object);

            var parameters = new List <string>()
            {
                "JSONExportEmployees"
            };

            // Act && Assert
            Assert.ThrowsException <ArgumentNullException>(() => JSONExportEmployeesMock.Execute(parameters));
        }
コード例 #3
0
        public void Execute_Should_Call_Export_Once()
        {
            // Arrange
            this.exporterStub.Setup(x => x.Export(It.IsAny <string>(), It.IsAny <string>()));

            var JSONExportEmployeesMock = new JSONExportEmployees(this.dbStub, this.serializerStub.Object, this.exporterStub.Object, this.writerStub.Object);

            var parameters = new List <string>()
            {
                "JSONExportEmployees",
                "all"
            };

            // Act
            JSONExportEmployeesMock.Execute(parameters);

            // Assert
            this.exporterStub.Verify(x => x.Export(It.IsAny <string>(), It.IsAny <string>()), Times.Once);
        }