public void GlobalSetUp() { // initialize one-time initialization data in this testfixture. tinyModel = new SimpleLanguageModelMock(1, 10, 0, 6, 0); bigModel = new SimpleLanguageModelMock(2, 1200, 10, 40, 0); entitiesAccessor = EntitiesAccessor.Instance; }
public void ShouldThrowExceptionParametersAreNullWhenSaving() { EntitiesAccessor target = EntitiesAccessor.Instance; string filename = null; target.SaveAssemblyElement(filename, null); target.SaveConfiguration(filename, null); target.SaveWeaveSpecification(filename, null); }
public void ShouldThrowExceptionParametersAreNullWhenLoading() { EntitiesAccessor target = EntitiesAccessor.Instance; string filename = null; AssemblyElement ae = target.LoadAssemblyElement(filename); ConfigurationContainer cc = target.LoadConfiguration(filename); WeaveSpecification ws = target.LoadWeaveSpecification(filename); }
public void ShouldThrowExceptionWhenFileNotFound() { EntitiesAccessor target = EntitiesAccessor.Instance; string filename = "doesnotexists.xml"; AssemblyElement ae = target.LoadAssemblyElement(filename); ConfigurationContainer cc = target.LoadConfiguration(filename); WeaveSpecification ws = target.LoadWeaveSpecification(filename); }
public void CanSaveAndLoadAssemblyElementTest() { EntitiesAccessor target = EntitiesAccessor.Instance; string filename = "assemblyElement.xml"; AssemblyElement ae = new AssemblyElement(); Assert.IsTrue(target.SaveAssemblyElement(filename, ae), "Save function for SaveAssemblyElement did not return true"); Assert.IsTrue(System.IO.File.Exists(filename), "File {0} did not exists while it should be wrtten.", filename); AssemblyElement actual = target.LoadAssemblyElement(filename); Assert.IsNotNull(actual, "Could not read file {0}.", filename); Assert.AreEqual(ae, actual, "Composestar.Repository.EntitiesAccessor.LoadAssemblyElement did not return the expected value."); }
public void CanSaveAndLoadConfigurationTest() { EntitiesAccessor target = EntitiesAccessor.Instance; string filename = "config.xml"; ConfigurationContainer cc = new ConfigurationContainer(); ConfigurationContainer actual; Assert.IsTrue(target.SaveConfiguration(filename, cc), "Save function for SaveConfiguration did not return true"); Assert.IsTrue(System.IO.File.Exists(filename), "File {0} did not exists while it should be wrtten.", filename); actual = target.LoadConfiguration(filename); Assert.IsNotNull(actual, "Could not read file {0}.", filename); }
public void CanSaveAndLoadWeaveSpecificationTest() { EntitiesAccessor target = EntitiesAccessor.Instance; string filename = "weavespec.xml"; WeaveSpecification expected = new WeaveSpecification(); expected.AssemblyName = "test"; WeaveSpecification actual; Assert.IsTrue(target.SaveWeaveSpecification(filename, expected), "Save function for SaveWeaveSpecification did not return true"); Assert.IsTrue(System.IO.File.Exists(filename), "File {0} did not exists while it should be wrtten.", filename); actual = target.LoadWeaveSpecification(filename); Assert.IsNotNull(actual, "Could not read file {0}.", filename); Assert.AreEqual(expected.AssemblyName, actual.AssemblyName, "Composestar.Repository.EntitiesAccessor.LoadWeaveSpecification did not return the expected value."); }