public void GetFromType_throws_if_no_ProviderInvariantNameAttribute()
 {
     Assert.Equal(
         Strings.DbProviderNameAttributeNotFound(typeof(Random)),
         Assert.Throws <InvalidOperationException>(
             () => DbProviderNameAttribute.GetFromType(typeof(Random))).Message);
 }
 public void GetFromType_doesnt_return_attributes_from_base()
 {
     Assert.Equal(
         Strings.DbProviderNameAttributeNotFound(typeof(AnotherSqlStrategy)),
         Assert.Throws <InvalidOperationException>(
             () => DbProviderNameAttribute.GetFromType(typeof(AnotherSqlStrategy))).Message);
 }
        public void GetFromType_returns_multiple_attributes()
        {
            var attributes = DbProviderNameAttribute.GetFromType(typeof(MultiProviderStrategy)).ToList();

            Assert.Equal(2, attributes.Count);
            Assert.Contains("One", attributes.Select(a => a.Name));
            Assert.Contains("Two", attributes.Select(a => a.Name));
        }
 public void GetFromType_returns_overriden_attribute()
 {
     Assert.Equal("NonSql", DbProviderNameAttribute.GetFromType(typeof(NonSqlStrategy)).Single().Name);
 }