public void FormatTreatmentsCommand_RunWithNullDocumentAndNullProgramSettings_ShouldThrowArgumentNullException()
        {
            // Arrange
            var formatterMock = new Mock <ITreatmentFormatter>();
            var command       = new FormatTreatmentsCommand(formatterMock.Object);

            // Act + Assert
            var exception = Assert.ThrowsAsync <ArgumentNullException>(() =>
            {
                return(command.Run(null, null));
            });

            formatterMock.Verify(p => p.Format(It.IsAny <IDocument>()), Times.Never);
        }
        public async Task FormatTreatmentsCommand_RunWithValidDocumentAndValidProgramSettings_ShouldCallParserWithCorrectParameter()
        {
            // Arrange
            var formatterMock = new Mock <ITreatmentFormatter>();
            var command       = new FormatTreatmentsCommand(formatterMock.Object);
            var settingsMock  = new Mock <ICommandSettings>();
            var documentMock  = new Mock <IDocument>();

            // Act
            var result = await command.Run(documentMock.Object, settingsMock.Object);

            // Assert
            formatterMock.Verify(p => p.Format(It.IsAny <IDocument>()), Times.Once);
            formatterMock.Verify(p => p.Format(documentMock.Object), Times.Once);
        }
        public void FormatTreatmentsCommand_RunWithValidDocumentAndNullProgramSettings_ShouldThrowArgumentNullExceptionWithCorrectParamName()
        {
            // Arrange
            var formatterMock = new Mock <ITreatmentFormatter>();
            var command       = new FormatTreatmentsCommand(formatterMock.Object);
            var documentMock  = new Mock <IDocument>();

            // Act + Assert
            var exception = Assert.ThrowsAsync <ArgumentNullException>(() =>
            {
                return(command.Run(documentMock.Object, null));
            });

            Assert.AreEqual(ParameterNames.Settings, exception.ParamName, "ParamName is not correct.");

            formatterMock.Verify(p => p.Format(It.IsAny <IDocument>()), Times.Never);
        }