Beispiel #1
0
 public void IsValidVersion_returns_false_for_invalid_versions()
 {
     Assert.False(EntityFrameworkVersion.IsValidVersion(null));
     Assert.False(EntityFrameworkVersion.IsValidVersion(new Version(0, 0, 0, 0)));
     Assert.False(EntityFrameworkVersion.IsValidVersion(new Version(4, 0, 0, 0)));
     Assert.False(EntityFrameworkVersion.IsValidVersion(new Version(3, 0)));
     Assert.False(EntityFrameworkVersion.IsValidVersion(new Version(2, 0, 0)));
 }
Beispiel #2
0
        private static string GetNamespaceName(Version schemaVersion, IDictionary <Version, XNamespace> xNamespaces)
        {
            Debug.Assert(schemaVersion != null, "schemaVersion != null");
            Debug.Assert(EntityFrameworkVersion.IsValidVersion(schemaVersion), "Invalid schema version.");
            Debug.Assert(xNamespaces != null, "xNamespaces != null");
            Debug.Assert(xNamespaces.ContainsKey(schemaVersion), "The requested namespace is not found");

            return(xNamespaces[schemaVersion].NamespaceName);
        }
Beispiel #3
0
 public void IsValidVersion_returns_true_for_valid_versions()
 {
     Assert.True(EntityFrameworkVersion.IsValidVersion(new Version(1, 0, 0, 0)));
     Assert.True(EntityFrameworkVersion.IsValidVersion(new Version(2, 0, 0, 0)));
     Assert.True(EntityFrameworkVersion.IsValidVersion(new Version(3, 0, 0, 0)));
 }