Beispiel #1
0
        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;
        }
Beispiel #2
0
        public void ShouldThrowExceptionParametersAreNullWhenSaving()
        {
            EntitiesAccessor target = EntitiesAccessor.Instance;

            string filename = null;

            target.SaveAssemblyElement(filename, null);
            target.SaveConfiguration(filename, null);
            target.SaveWeaveSpecification(filename, null);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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.");
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        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.");
        }