示例#1
0
        public void JsonDeserializeModelTest()
        {
            string        filePath   = "CalcAppModel.json";
            string        content    = Utility.ReadFileContent(filePath);
            AppDescriptor descriptor = JsonUtil.DeserializeObject <AppDescriptor>(content);

            Assert.AreEqual(descriptor.Children.Count, 1);
            Assert.AreEqual(TestUtility.Count(descriptor.Children[0].Children), 10);
            Assert.AreEqual(descriptor.ProcessName, "calculator.exe");
        }
示例#2
0
        public void ShouldGetAppsToBeDeployed()
        {
            var appToBeDeployed = _testAnabasisBuild.GetApplicationsToDeploy();

            Assert.AreEqual(1, appToBeDeployed.Length);

            _testApp = appToBeDeployed.First();

            Assert.AreEqual("appgroup-anabasis-deployment-test-app", _testApp.AppLongName);
        }
示例#3
0
        public static bool Save(AppModel model, StreamWriter stream)
        {
            AppDescriptor appDescriptor = new AppDescriptor(model);

            string serializedContent = JsonUtil.SerializeObject(appDescriptor, true, true);

            stream.Write(serializedContent);

            return(true);
        }
示例#4
0
        public static bool Save(AppModel model, string filePath)
        {
            AppDescriptor appDescriptor = new AppDescriptor(model);

            string serializedContent = JsonUtil.SerializeObject(appDescriptor, true, true);

            Utility.WriteFileContent(filePath, serializedContent);

            model.ModelFile = new AppModelFile(filePath);

            return(true);
        }
示例#5
0
        public void AppDescriptor_ctor_AppModel()
        {
            AppModel model = new AppModel();

            model.Add(new UIATestObject());
            model.Add(new UIATestObject());

            model.ProcessName = "TestProcess.exe";
            AppDescriptor descriptor = new AppDescriptor(model);

            Assert.AreEqual("TestProcess.exe", descriptor.ProcessName);

            Assert.AreEqual(2, descriptor.Children.Count);
        }
示例#6
0
        public static AppModel Load(string filePath, ModelLoadLevel level = ModelLoadLevel.ReplayOnly)
        {
            if (!File.Exists(filePath))
            {
                throw new FileNotFoundException(string.Format("File {0} does not exist", filePath));
            }
            string content = Utility.ReadFileContent(filePath);

            AppDescriptor appDescriptor = JsonUtil.DeserializeObject <AppDescriptor>(content, level);

            AppModel model = appDescriptor.GetObject();

            model.ModelFile = new AppModelFile(filePath);

            return(model);
        }
示例#7
0
        public void AppDescriptor_GetObject()
        {
            AppDescriptor appDescriptor = new AppDescriptor();

            appDescriptor.ProcessName = "TestProcess.exe";
            appDescriptor.Children.Add(new ObjectDescriptor()
            {
                Type = NodeType.UIAControl
            });
            appDescriptor.Children.Add(new ObjectDescriptor()
            {
                Type = NodeType.UIAControl
            });

            AppModel appModel = appDescriptor.GetObject();

            Assert.AreEqual("TestProcess.exe", appModel.ProcessName);

            Assert.AreEqual(2, appModel.AllItems.Count);
        }
示例#8
0
 public TriangleApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }
示例#9
0
 public TextureCubeApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }
示例#10
0
 public ClearApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }
示例#11
0
 public CubeApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }
示例#12
0
 public static void Setup(AppDescriptor descriptor)
 {
     SetCallbacks(ref descriptor.Callbacks);
     Kernel.Setup(descriptor.ModuleTypes);
 }
示例#13
0
 public NonInterleavedApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }
示例#14
0
 public OffscreenApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }
示例#15
0
 public MultipleRenderTargetsApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }
示例#16
0
 public BufferOffsetsApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }
示例#17
0
 public QuadApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }
示例#18
0
 public InstancingApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }
示例#19
0
 public DynTexApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }
示例#20
0
 public ArrayTexApplication(AppDescriptor descriptor)
     : base(descriptor)
 {
 }