Bamboo.Prevalence.VersionMigration.Tests.MigrationPlanTests.TestMigrationPlanLoad C# (CSharp) Метод

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

private TestMigrationPlanLoad ( ) : void
Результат void
		public void TestMigrationPlanLoad()
		{
			MigrationPlan plan = MigrationPlan.Load("test-plan-1.xml");
			AssertNotNull("MigrationPlan.Load", plan);

			AssertNotNull("plan.Culture", plan.Culture);
			AssertEquals("plan.Culture", CultureInfo.CreateSpecificCulture("pt-br"), plan.Culture);
			
			TypeMappingCollection mappings = plan.TypeMappings;
			AssertNotNull("plan.TypeMappings", mappings);

			// 3 mappings counting the aliases...
			AssertEquals("mappings.Count", 3, mappings.Count);

			TypeMapping mapping = mappings["SamplePrevalentSystem.Title"];
			AssertNotNull("mapping", mapping);
			AssertEquals(string.Empty, mapping.AssemblyName);
			AssertEquals("mapping.FieldMappings.Count", 3, mapping.FieldMappings.Count);

			mapping = mappings["SamplePrevalentSystem.LibrarySystem"];
			AssertNotNull("mapping", mapping);
			AssertEquals(string.Empty, mapping.AssemblyName);

			AssertEquals(mapping, mappings["SamplePrevalentSystem.Library"]);
			
			AssertEquals(2, plan.Scripts.Count);
			
			Script s = plan.Scripts[0];
			AssertEquals("context", s.TargetObject);
			AssertEquals("AfterDeserialization", s.TargetEvent);
			AssertEquals("// Nothing here...", s.Code);
			AssertEquals("vb", s.Language);
			
			s = plan.Scripts[1];
			AssertEquals("c# must be the default language", "c#", s.Language);
			AssertEquals(1, s.Imports.Count);
			AssertEquals("SamplePrevalentSystem", s.Imports[0].Namespace);
		}
	}
MigrationPlanTests