Ejemplo n.º 1
0
        public void CanUploadSystemModule()
        {
            var guid = Guid.NewGuid();

            var module = new SystemModule
            {
                AssemblyName = "Assembly Module Test",
                Id = 0,
                SystemModuleGuid = guid
            };

            module.Register(Repository);

            var systemModule = Repository.FindAll<SystemModule>(sm => sm.AssemblyName == module.AssemblyName);

            Assert.IsNotNull(systemModule);
            Assert.AreEqual("Assembly Module Test", module.AssemblyName);
            Assert.AreEqual(guid, module.SystemModuleGuid);
        }
Ejemplo n.º 2
0
        private void RegisterModuleInDatabase(CloudCoreModule module)
        {
            var systemModule = new SystemModule
            {
                SystemModuleId = 0,
                AssemblyName = module.AssemblyName,
                SystemModuleGuid = module.UniqueModuleId
            };

            int? systemModuleId = null;
            CloudCoreDB.Context.Cloudcore_SystemModuleUpload(module.AssemblyName, module.UniqueModuleId, ref systemModuleId);

            //The bottom statement should always be true, I cannot see why the Exception would ever be thrown...
            //if (systemModuleId.GetValueOrDefault(0) > 0)
            module.SystemModuleIdOnDatbase = systemModuleId.Value;
            //else
            //    throw new Exception("Could not register the CloudCore module \"" + module.AssemblyName +
            //                        "\" in the database. Reason unknown.");
        }