System.Data.Entity.DbConfigurationTests.SetTransactionHandler.Throws_if_given_a_null_provider_or_bad_invariant_name C# (CSharp) Метод

Throws_if_given_a_null_provider_or_bad_invariant_name() приватный Метод

private Throws_if_given_a_null_provider_or_bad_invariant_name ( ) : void
Результат void
            public void Throws_if_given_a_null_provider_or_bad_invariant_name()
            {
                Assert.Equal(
                    "transactionHandlerFactory",
                    Assert.Throws<ArgumentNullException>(() => new DbConfiguration().SetDefaultTransactionHandler(null)).ParamName);

                Assert.Equal(
                    Strings.ArgumentIsNullOrWhitespace("providerInvariantName"),
                    Assert.Throws<ArgumentException>(
                        () => new DbConfiguration().SetTransactionHandler(null, () => null)).Message);

                Assert.Equal(
                    "transactionHandlerFactory",
                    Assert.Throws<ArgumentNullException>(() => new DbConfiguration().SetTransactionHandler("p", null)).ParamName);

                Assert.Equal(
                    Strings.ArgumentIsNullOrWhitespace("providerInvariantName"),
                    Assert.Throws<ArgumentException>(
                        () => new DbConfiguration().SetTransactionHandler(null, () => null, "s")).Message);

                Assert.Equal(
                    "transactionHandlerFactory",
                    Assert.Throws<ArgumentNullException>(() => new DbConfiguration().SetTransactionHandler("p", null, "s")).ParamName);

                Assert.Equal(
                    Strings.ArgumentIsNullOrWhitespace("serverName"),
                    Assert.Throws<ArgumentException>(
                        () => new DbConfiguration().SetTransactionHandler("p", () => null, null)).Message);
            }