System.Data.Entity.DbConfigurationTests.SetSpatialServices.Throws_if_given_a_null_factory_or_key_or_an_empty_invariant_name C# (CSharp) Méthode

Throws_if_given_a_null_factory_or_key_or_an_empty_invariant_name() private méthode

            public void Throws_if_given_a_null_factory_or_key_or_an_empty_invariant_name()
            {
                Assert.Equal(
                    "spatialProvider",
                    Assert.Throws<ArgumentNullException>(() => new DbConfiguration().SetSpatialServices("Good.As.Gold", null)).ParamName);

                Assert.Equal(
                    "spatialProvider",
                    Assert.Throws<ArgumentNullException>(
                        () => new DbConfiguration().SetSpatialServices(new DbProviderInfo("Especially.For.You", ""), null)).ParamName);

                Assert.Equal(
                    "key",
                    Assert.Throws<ArgumentNullException>(
                        () => new DbConfiguration().SetSpatialServices((DbProviderInfo)null, new Mock<DbSpatialServices>().Object))
                        .ParamName);

                Assert.Equal(
                    Strings.ArgumentIsNullOrWhitespace("providerInvariantName"),
                    Assert.Throws<ArgumentException>(
                        () => new DbConfiguration().SetSpatialServices((string)null, new Mock<DbSpatialServices>().Object)).Message);

                Assert.Equal(
                    Strings.ArgumentIsNullOrWhitespace("providerInvariantName"),
                    Assert.Throws<ArgumentException>(
                        () => new DbConfiguration().SetSpatialServices("", new Mock<DbSpatialServices>().Object)).Message);

                Assert.Equal(
                    Strings.ArgumentIsNullOrWhitespace("providerInvariantName"),
                    Assert.Throws<ArgumentException>(
                        () => new DbConfiguration().SetSpatialServices(" ", new Mock<DbSpatialServices>().Object)).Message);
            }