Exemplo n.º 1
0
            public void Should_Throw_If_Settings_Is_Null()
            {
                // Given
                var fixture = new NuGetSourcesFixture();

                fixture.Settings = null;

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

                // Then
                Assert.IsArgumentNullException(result, "settings");
            }
Exemplo n.º 2
0
            public void Should_Throw_If_Source_Is_Empty(string source)
            {
                // Given
                var fixture = new NuGetSourcesFixture();

                fixture.Source = string.Empty;

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

                // Then
                Assert.Equal("source", ((ArgumentException)result).ParamName);
                Assert.Equal(string.Format("Source cannot be empty.{0}Parameter name: source", Environment.NewLine), result.Message);
            }