public void TestOfAddition()
        {
            AppModel.Initialize();
            SettingsModel.Initialize();
            var Char = TestHelper.CreateTestChar();

            Assert.IsTrue(Char.CTRLAttribut.Charisma.Wert == 0);
            Assert.IsTrue(Char.CTRLAttribut.Logik.Wert == 0);
            Assert.IsTrue(Char.CTRLVorteil.Data[0].Wert == 0);
            Assert.IsTrue(Char.CTRLHandlung.Data[0].Wert == 0);
            Assert.IsTrue(Char.CTRLHandlung.Data[0].Value.Value == 0);
            Assert.IsTrue(Char.CTRLHandlung.Data[0].Gegen == 0);

            Char.CTRLAttribut.Charisma.Wert++;

            Assert.IsTrue(Char.CTRLAttribut.Charisma.Wert == 1);
            Assert.IsTrue(Char.CTRLAttribut.Logik.Wert == 0);
            Assert.IsTrue(Char.CTRLVorteil.Data[0].Wert == 0);
            Assert.IsTrue(Char.CTRLHandlung.Data[0].Gegen == 0);
            Assert.IsTrue(Char.CTRLHandlung.Data[0].Wert == 0);
            Assert.IsTrue(Char.CTRLHandlung.Data[0].Value.Value == 1);

            Char.CTRLVorteil.Data[0].Wert++;

            Assert.IsTrue(Char.CTRLAttribut.Charisma.Wert == 1);
            Assert.IsTrue(Char.CTRLAttribut.Logik.Wert == 0);
            Assert.IsTrue(Char.CTRLVorteil.Data[0].Wert == 1);
            Assert.IsTrue(Char.CTRLHandlung.Data[0].Wert == 0);
            Assert.IsTrue(Char.CTRLHandlung.Data[0].Value.Value == 1);
            Assert.IsTrue(Char.CTRLHandlung.Data[0].GegenCalced == 1);
        }
Exemplo n.º 2
0
 public MainWindow()
 {
     Test();
     InitializeComponent();
     m_appModel = new AppModel();
     this.DataContext = m_appModel;
     ConnectEvents();
     m_appModel.Initialize();
 }
Exemplo n.º 3
0
 public static void InitModel()
 {
     if (Settings is null)
     {
         Settings = SettingsModel.Initialize();
     }
     if (Model is null)
     {
         Model = AppModel.Initialize();
     }
 }
Exemplo n.º 4
0
        public void UIATestObject_FindRecursive()
        {
            AppModel.Initialize("UnitTestObjectModel1.json");
            UIATestObject parentObject = (UIATestObject)AppModel.Current.GetTestObject("LAP (Running) - Microsoft Visual Studio");

            UIATestObject testObject = (UIATestObject)parentObject.FindRecursive(DescriptorKeys.NodeName, "Search");

            Assert.IsNotNull(testObject, "Should find the test object in the model");

            testObject = (UIATestObject)parentObject.FindRecursive(DescriptorKeys.NodeName, "NotExistObject");
            Assert.IsNull(testObject, "Should not the test object with a random name");
        }
Exemplo n.º 5
0
        public void ControlSearcher_GetCondition()
        {
            AppModel.Initialize("UnitTestObjectModel1.json");
            UIATestObject parentObject = (UIATestObject)AppModel.Current.GetTestObject("LAP (Running) - Microsoft Visual Studio");

            //UIATestObject testObject = (UIATestObject)parentObject.FindRecursive(DescriptorKeys.NodeName, "Search");

            Assert.IsNotNull(parentObject, "Should find the parent test object in the model");

            UIACondition parentCondition = UIACondition.GetCondition(parentObject);

            UIACondition childCondition = ControlSearcher.GetCondition(parentCondition, ControlType.Edit, "Search");

            Assert.IsNotNull(childCondition, "Should not be able to find the child condition");
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        internal App()
        {
            TLIB.PlatformHelper.ModelHelper.Platform  = new TLIB.Code.Uwp.UwpModelHelper();
            TLIB.PlatformHelper.StringHelper.Platform = new TLIB.Code.Uwp.UwpStringHelper();

            TAPPLICATION.IO.SharedIO.CurrentIO = new TLIB.Code.Uwp.UwpIO();
            TAPPLICATION.Model.SharedSettingsModel.PlatformSettings = new TLIB.Code.Uwp.UwpSettings();

            AppModel.Initialize();
            SettingsModel.Initialize();
            this.InitializeComponent();
            _displayRequest = new Windows.System.Display.DisplayRequest();
            _displayRequest.RequestActive();
            this.Suspending         += OnSuspending;
            this.UnhandledException += App_UnhandledExceptionAsync;
            UnhandledException      += App_UnhandledExceptionAsync;

            SharedSettingsModel.Instance.FOLDERMODE  = false;
            SharedSettingsModel.Instance.INTERN_SYNC = true;
        }
Exemplo n.º 7
0
        public void TestOfAddition_N()
        {
            AppModel.Initialize();
            SettingsModel.Initialize();

            CharHolder Char = new CharHolder();
            var        H1   = new Handlung()
            {
                Bezeichner = "Handlung1"
            };

            Char.Add(H1);
            Char.Add(new Item()
            {
                Bezeichner = "Item"
            });

            H1.Value.Connected.Add(Char.CTRLAttribut.Charisma.Value);
            H1.Value.Connected.Add(Char.CTRLItem[0].Value);
            TestNewConnections(Char);
        }
Exemplo n.º 8
0
        public void TestLoadAndSave_N()
        {
            AppModel.Initialize();
            SettingsModel.Initialize();
            CharHolder Char = new CharHolder();
            var        H1   = new Handlung()
            {
                Bezeichner = "Handlung1"
            };

            Char.Add(H1);
            Char.Add(new Item()
            {
                Bezeichner = "Item"
            });

            H1.Value.Connected.Add(Char.CTRLAttribut.Charisma.Value);
            H1.Value.Connected.Add(Char.CTRLItem[0].Value);

            string Ser = SharedIO.Serialize(Char);

            TestNewConnections(CharHolderIO.Deserialize(Ser));
        }
Exemplo n.º 9
0
 public void LoadRepository(string path)
 {
     AppModel.Initialize(path);
 }
Exemplo n.º 10
0
 public static void Init(TestContext context)
 {
     AppModel.Initialize("UnitTestObjectModel1.json");
 }
Exemplo n.º 11
0
 public void Initialize(string pathToModel)
 {
     AppModel.Initialize(pathToModel);
 }