Esempio n. 1
0
                public void Should_Pack_If_Sufficient_Settings_For_MetaPackage_With_TargetFrameWork_Specified()
                {
                    // Given
                    var fixture = new NuGetPackerWithoutNuSpecFixture();

                    fixture.Settings.OutputDirectory = "/Working/";
                    fixture.Settings.Id           = "nonexisting";
                    fixture.Settings.Version      = "1.0.0";
                    fixture.Settings.Description  = "The description";
                    fixture.Settings.Authors      = new[] { "Author #1", "Author #2" };
                    fixture.Settings.Files        = null;
                    fixture.Settings.Dependencies = new List <NuSpecDependency>
                    {
                        new NuSpecDependency {
                            Id = "Test1", Version = "1.0.0", TargetFramework = "net452"
                        },
                        new NuSpecDependency {
                            Id = "Test1", Version = "1.0.0", TargetFramework = "net462"
                        }
                    };

                    // When
                    var result = fixture.Run();

                    // Then
                    Assert.Equal(
                        Resources.Nuspec_Metadata_WithTargetFrameworkDependencies.NormalizeLineEndings(),
                        result.NuspecContent.NormalizeLineEndings());
                }
Esempio n. 2
0
                public void Should_Pack_If_Sufficient_Settings_For_MetaPackage_Specified()
                {
                    // Given
                    var fixture = new NuGetPackerWithoutNuSpecFixture();

                    fixture.Settings.OutputDirectory = "/Working/";
                    fixture.Settings.Id           = "nonexisting";
                    fixture.Settings.Version      = "1.0.0";
                    fixture.Settings.Description  = "The description";
                    fixture.Settings.Authors      = new[] { "Author #1", "Author #2" };
                    fixture.Settings.Files        = null;
                    fixture.Settings.Dependencies = new List <NuSpecDependency>
                    {
                        new NuSpecDependency {
                            Id = "Test1", Version = "1.0.0"
                        }
                    };

                    // When
                    var result = fixture.Run();

                    // Then
                    Assert.Equal("pack -Version \"1.0.0\" -OutputDirectory \"/Working\" " +
                                 "\"/Working/nonexisting.temp.nuspec\"", result.Args);
                }
Esempio n. 3
0
                public void Should_Throw_If_OutputDirectory_Setting_Not_Specified()
                {
                    // Given
                    var fixture = new NuGetPackerWithoutNuSpecFixture();

                    // When
                    var result = Record.Exception(() => fixture.Run());

                    // Then
                    Assert.IsCakeException(result, "Required setting OutputDirectory not specified or doesn't exists.");
                }
Esempio n. 4
0
                public void Should_Throw_If_Id_Setting_Not_Specified()
                {
                    // Given
                    var fixture = new NuGetPackerWithoutNuSpecFixture();

                    fixture.Settings.OutputDirectory = "/Working/";

                    // When
                    var result = Record.Exception(() => fixture.Run());

                    // Then
                    Assert.IsCakeException(result, "Required setting Id not specified.");
                }
Esempio n. 5
0
                public void Should_Throw_If_Authors_Setting_Not_Specified()
                {
                    // Given
                    var fixture = new NuGetPackerWithoutNuSpecFixture();

                    fixture.Settings.OutputDirectory = "/Working/";
                    fixture.Settings.Id      = "nonexisting";
                    fixture.Settings.Version = "1.0.0";

                    // When
                    var result = Record.Exception(() => fixture.Run());

                    // Then
                    AssertEx.IsCakeException(result, "Required setting Authors not specified.");
                }
Esempio n. 6
0
                public void Should_Throw_If_Files_Setting_And_Dependencies_Not_Specified()
                {
                    // Given
                    var fixture = new NuGetPackerWithoutNuSpecFixture();

                    fixture.Settings.OutputDirectory = "/Working/";
                    fixture.Settings.Id           = "nonexisting";
                    fixture.Settings.Version      = "1.0.0";
                    fixture.Settings.Authors      = new[] { "Author #1", "Author #2" };
                    fixture.Settings.Description  = "The description";
                    fixture.Settings.Dependencies = null;
                    fixture.Settings.Files        = null;
                    // When
                    var result = Record.Exception(() => fixture.Run());

                    // Then
                    Assert.IsCakeException(result, "Required setting Files not specified.");
                }
Esempio n. 7
0
                public void Should_Pack_If_Sufficient_Settings_Specified()
                {
                    // Given
                    var fixture = new NuGetPackerWithoutNuSpecFixture();

                    fixture.Settings.OutputDirectory = "/Working/";
                    fixture.Settings.Id          = "nonexisting";
                    fixture.Settings.Version     = "1.0.0";
                    fixture.Settings.Description = "The description";
                    fixture.Settings.Authors     = new[] { "Author #1", "Author #2" };
                    fixture.Settings.Files       = new[]
                    {
                        new NuSpecContent {
                            Source = "LICENSE"
                        }
                    };

                    // When
                    var result = fixture.Run();

                    // Then
                    Assert.Equal("pack -Version \"1.0.0\" -OutputDirectory \"/Working\" " +
                                 "\"/Working/nonexisting.temp.nuspec\"", result.Args);
                }