Esempio n. 1
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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        public void WeaveTypesTest()
        {
            WeaveSpecification target = new WeaveSpecification();

            System.Collections.Generic.List <Composestar.StarLight.Entities.WeaveSpec.WeaveType> val = null; // TODO: Assign to an appropriate value for the property

            target.WeaveTypes = val;


            Assert.AreEqual(val, target.WeaveTypes, "Composestar.StarLight.Entities.WeaveSpec.WeaveSpecification.WeaveTypes was not se" +
                            "t correctly.");
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Esempio n. 4
0
        public void AssemblyNameTest()
        {
            WeaveSpecification target = new WeaveSpecification();

            string val = null; // TODO: Assign to an appropriate value for the property

            target.AssemblyName = val;


            Assert.AreEqual(val, target.AssemblyName, "Composestar.StarLight.Entities.WeaveSpec.WeaveSpecification.AssemblyName was not " +
                            "set correctly.");
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Esempio n. 5
0
        /// <summary>
        /// Saves the weave specification.
        /// </summary>
        /// <param name="fileName">The fileName.</param>
        /// <param name="weaveSpecification">The weave specification.</param>
        /// <returns></returns>
        public bool SaveWeaveSpecification(string fileName, WeaveSpecification weaveSpecification)
        {
            if (weaveSpecification == null)
            {
                throw new ArgumentNullException("weaveSpecification");
            }

            if (string.IsNullOrEmpty(fileName))
            {
                throw new ArgumentNullException("fileName");
            }

            ObjectXMLSerializer <WeaveSpecification> .Save(weaveSpecification, fileName, SerializedFormat.DocumentCompressed);

            return(true);
        }
Esempio n. 6
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.");
        }