Beispiel #1
0
        public void MinimalRepoPackWithoutErrors(bool isShippable, string destinationFolder)
        {
            // Given
            TestApp app = this.fixture.ProvideTestApp("MinimalRepoWithTests")
                          .WithPreCreate("git", "init")
                          .WithPreCreate("git", "remote", "add", "origin", "http://localhost")
                          .WithPreCreate("git", "checkout", "-b", "main")
                          .WithPreCreate("git", "commit", "--allow-empty", "-m", "Dummy happy empty commit.")
                          .Create(this.output);
            var expectedVersion = "1.0.0-local.*";
            var packageFileName = $"ClassLib1.{expectedVersion}.nupkg";

            // When
            int exitCode = app.ExecuteBuild(
                this.output,
                "-test",
                "-pack",
                $"/p:IsShippable={isShippable}");

            // Then
            Assert.Equal(0, exitCode);
            Assert.Single(Directory.GetFiles(Path.Combine(app.WorkingDirectory, "artifacts", "packages", "Debug", destinationFolder), packageFileName));
        }