예제 #1
0
        private void CheckParameterSetting(Action <BitDifferSettings> settingsChange, string expectedArgument,
                                           bool shouldContainArgument)
        {
            // Arrange
            var settings = new BitDifferSettings
            {
                CurrentAssemblyFile  = _CURRENT,
                PreviousAssemblyFile = _PREVIOUS
            };

            settingsChange(settings); // Configure settings for test
            var sut = new BitDifferFixture {
                Settings = settings
            };

            // Act
            Testing.Fixtures.ToolFixtureResult result = sut.Run();

            // Assert
            if (shouldContainArgument)
            {
                result.Args.Should().ContainEquivalentOf(expectedArgument);
            }
            else
            {
                result.Args.Should().NotContainEquivalentOf(expectedArgument);
            }
        }
예제 #2
0
        public void NoSettings_Throws()
        {
            // Arrange
            var sut = new BitDifferFixture {
                Settings = null
            };

            // Act
            var sutAction = new Action(() => sut.Run());

            // Assert
            sutAction.Should().ThrowExactly <ArgumentNullException>()
            .Which.ParamName.Should().Be("settings");
        }
예제 #3
0
        public void NoCurrentAssemblyFileName_Throws(string assemblyFile)
        {
            // Arrange
            var settings = new BitDifferSettings
            {
                CurrentAssemblyFile  = assemblyFile,
                PreviousAssemblyFile = _PREVIOUS
            };
            var sut = new BitDifferFixture {
                Settings = settings
            };

            // Act
            var sutAction = new Action(() => sut.Run());

            // Assert
            sutAction.Should().ThrowExactly <ArgumentException>()
            .Which.ParamName.Should().Be(nameof(BitDifferSettings.CurrentAssemblyFile));
        }
예제 #4
0
        public void AssemblyFilesSetAsParameters()
        {
            // Arrange
            var settings = new BitDifferSettings
            {
                CurrentAssemblyFile  = _CURRENT,
                PreviousAssemblyFile = _PREVIOUS
            };
            var sut = new BitDifferFixture {
                Settings = settings
            };

            // Act
            Testing.Fixtures.ToolFixtureResult result = sut.Run();

            // Assert
            result.Args.Should()
            .EndWith(
                "\"/Working/TestFiles/Version1/Cake.BitDiffer.TestAssembly.dll\" \"/Working/TestFiles/Version2/Cake.BitDiffer.TestAssembly.dll\"");
        }