Example #1
0
 public void CreateTextUI()
 {
     _reportBuilder = new StringBuilder();
     var writer = new ExtendedTextWrapper(new StringWriter(_reportBuilder));
     var options = new NUnitLiteOptions();
     _textUI = new TextUI(writer, null, options);
 }
Example #2
0
    public static int Main(string[] args)
    {
        TextUI runner;

        // Make sure the TLS subsystem including the DependencyInjector is initialized.
        // This would normally happen on system startup in
        // `xamarin-macios/src/ObjcRuntime/Runtime.cs`.
        MonoTlsProviderFactory.Initialize();

        // First argument is the connection string
        if (args [0].StartsWith("tcp:"))
        {
            var parts = args [0].Split(':');
            if (parts.Length != 3)
            {
                throw new Exception();
            }
            string host = parts [1];
            string port = parts [2];
            args = args.Skip(1).ToArray();

            Console.WriteLine($"Connecting to harness at {host}:{port}.");
            runner = new TextUI(new TcpWriter(host, Int32.Parse(port)));
        }
        else
        {
            runner = new TextUI();
        }
        runner.Execute(args);

        return(runner.Failure ? 1 : 0);
    }
Example #3
0
    private static void RunTests(Assembly assembly, string[] commandArgs)
    {
        Debug.Log("Running Assembly: " + assembly.FullName);
        if (assembly == null)
        {
            throw new ArgumentNullException("assembly");
        }

        //  if (Tested.Contains(assembly))
        //    return;
        Tested.Add(assembly);

        using (var sw = new StringWriter())
        {
            if (commandArgs != null)
            {
                //var runner = new NunitTextUnityTestUI(sw);
                var runner = new TextUI();
                runner.Execute(commandArgs);
            }
            else
            {
                var runner        = new NUnitStreamUI(sw);
                var resultSummary = runner.Summary;
                var resultText    = sw.GetStringBuilder().ToString();
                Presenter(resultText, resultSummary);
            }
        }
    }
Example #4
0
    public void Setup()
    {
        SETUP = MainTitleUI.getSetup();
        PLAYERDATA = GameObject.FindGameObjectWithTag("PlayerData").GetComponent<PlayerData>();
        PLAYERDATA.Launch();
        ThumbGO = new GameObject("Thumbnails");
        ThumbGO.transform.parent = gameObject.transform;
        ThumbGO.transform.localPosition = new Vector3(0f,0f,0f);
        levelName = FETool.findWithinChildren(gameObject, "LevelTitle/LEVEL_NAME").GetComponent<TextUI>();
        _btnLeft = FETool.findWithinChildren(gameObject, "SelectLeft").GetComponent<LevelChooserButton>();
        _btnRight = FETool.findWithinChildren(gameObject, "SelectRight").GetComponent<LevelChooserButton>();

        Thumbs.Clear();
        foreach (LevelInfo _lvl in PLAYERDATA.PROFILE.ActivatedLevels)
        {
            LevelThumbnail _th = CreateThumbnail(_lvl);
            Thumbs.Add(_th);
        }
        for (int j = 0; j < Thumbs.Count ; j++)
        {
        //			Thumbs[j].gameObject.transform.localPosition = new Vector3(0f,0f,0f);
            Thumbs[j].gameObject.transform.localPosition = new Vector3(j * gapThumbs.x, 0f, gapThumbs.z);
        }

        Thumbs[0].isStartSlot = true;
        Thumbs[Thumbs.Count-1].isEndSlot = true;

        _btnLeft.Setup(this, LevelChooserButton.DirectionList.Left);
        _btnRight.Setup(this, LevelChooserButton.DirectionList.Right);
        currThumb = Thumbs[0];
        levelName.text = currThumb.nameLv.ToString();
        checkCurrThumb();
    }
Example #5
0
 public override void OnInspectorGUI()
 {
     base.OnInspectorGUI();
     text = (TextUI)target;
     if (GUILayout.Button("FormatText"))
     {
         text.Format();
     }
     if (GUILayout.Button("TranslateThis"))
     {
         text.TranslateThis();
     }
     if (GUILayout.Button("TranslateAllInScene"))
     {
         text.TranslateAllInScene();
     }
     if (GUILayout.Button("renameAllTextObject"))
     {
         text.renameAllTextObject();
     }
     if (GUILayout.Button("Setup_DialogID"))
     {
         text.SetupDialogIDFromGameObject();
     }
 }
Example #6
0
 // The main program executes the tests. Output may be routed to
 // various locations, depending on the arguments passed.
 //
 // Arguments:
 //
 //  Arguments may be names of assemblies or options prefixed with '/'
 //  or '-'. Normally, no assemblies are passed and the calling
 //  assembly (the one containing this Main) is used. The following
 //  options are accepted:
 //
 //    -test:<testname>  Provides the name of a test to be exected.
 //                      May be repeated. If this option is not used,
 //                      all tests are run.
 //
 //    -out:PATH         Path to a file to which output is written.
 //                      If omitted, Console is used, which means the
 //                      output is lost on a platform with no Console.
 //
 //    -full             Print full report of all tests.
 //
 //    -result:PATH      Path to a file to which the XML test result is written.
 //
 //    -explore[:Path]   If specified, list tests rather than executing them. If a
 //                      path is given, an XML file representing the tests is written
 //                      to that location. If not, output is written to tests.xml.
 //
 //    -noheader,noh     Suppress display of the initial message.
 //
 //    -wait             Wait for a keypress before exiting.
 //
 //    -include:categorylist 
 //             If specified, nunitlite will only run the tests with a category 
 //             that is in the comma separated list of category names. 
 //             Example usage: -include:category1,category2 this command can be used
 //             in combination with the -exclude option also note that exlude takes priority
 //             over all includes.
 //
 //    -exclude:categorylist 
 //             If specified, nunitlite will not run any of the tests with a category 
 //             that is in the comma separated list of category names. 
 //             Example usage: -exclude:category1,category2 this command can be used
 //             in combination with the -include option also note that exclude takes priority
 //             over all includes
 public static int Main(string[] args)
 {
     var runner = new TextUI();
     runner.Execute(args);
     
     return (runner.Failure ? 1 : 0);
 }
Example #7
0
        // let's try to keep everything not part of the UI away from this file
        public MainWindow()
        {
            ATD atd = new ATD();
            atd.execute();

            InitializeComponent();

            new HotKeyHandler(this);
            new MinimizeEventHandler(this);

            controller = new ControlCenter(this);
            commandLine.Focus();
            //taskListDataGrid.FontFamily = new System.Windows.Media.FontFamily("/ToDoOrNoToDo;component/image/#Buxton Sketch");

            // installing UIs to the system
            gui = new GUI(GuiElement, manbox, taskListDataGrid, controller);
            textui = new TextUI(TextUIElement, terminal);

            controller.installUI(gui);
            controller.installUI(textui);
            DataContext = gui;
            taskListDataGrid.SelectedCellsChanged += new System.Windows.Controls.SelectedCellsChangedEventHandler(taskListDataGrid_SelectedCellsChanged);

            gui.enable();
            textui.disable();
            currentui = gui;
        }
Example #8
0
    // Use this for initialization
    public void Setup()
    {
        GameEventManager.GameStart += GameStart;
        GameEventManager.EndGame += EndGame;
        subMenuList = submenus.EndGame;

        _LeaderboardUI = transform.parent.GetComponentInChildren<LeaderboardUI>();
        _lb = transform.parent.GetComponentInChildren<PhpLeaderboards>();
        _RespawnUI = transform.parent.GetComponentInChildren<RespawnUI>();

        lbInitpos = _LeaderboardUI.transform.localPosition;
        lbOutPos = new Vector3 (lbInitpos.x, lbInitpos.y-5f, lbInitpos.z);

        respInitpos = _RespawnUI.transform.localPosition;
        respOutPos = new Vector3 (respInitpos.x-20f, respInitpos.y, respInitpos.z);

        BackOne = FETool.findWithinChildren(gameObject, "Background/p1");
        BackTwo = FETool.findWithinChildren(gameObject, "Background/p2");
        BackOneIn = FETool.findWithinChildren(gameObject, "Background/newPosP1");
        BackTwoIn = FETool.findWithinChildren(gameObject, "Background/newPosP2");
        Succeed = FETool.findWithinChildren(gameObject, "SUCCEED").GetComponent<TextUI>();
        CurrLvl = FETool.findWithinChildren(gameObject, "CURRLVL").GetComponent<TextUI>();
        CurrLvl.text = LevelManager.CurrentLevelInfo.LvlName.ToString();

        CrabbySpr = FETool.findWithinChildren(gameObject, "Crab").GetComponentInChildren<OTSprite>();
        StrokeSpr = FETool.findWithinChildren(gameObject, "Door/Stroke").GetComponentInChildren<OTSprite>();
        VortexSpr = FETool.findWithinChildren(gameObject, "Door/Vortex").GetComponentInChildren<OTSprite>();
    }
Example #9
0
    public static int Main(string[] args)
    {
        TextUI runner;

        // First argument is the connection string
        if (args [0].StartsWith("tcp:"))
        {
            var parts = args [0].Split(':');
            if (parts.Length != 3)
            {
                throw new Exception();
            }
            string host = parts [1];
            string port = parts [2];
            args = args.Skip(1).ToArray();

            Console.WriteLine($"Connecting to harness at {host}:{port}.");
            runner = new TextUI(new TcpWriter(host, Int32.Parse(port)));
        }
        else
        {
            runner = new TextUI();
        }
        runner.Execute(args);

        return(runner.Failure ? 1 : 0);
    }
Example #10
0
    public static void RunTests(IntPtr androidRunner)
    {
        AndroidRunner = androidRunner;

        Console.SetOut(TextWriter.Synchronized(new AndroidIntrumentationWriter(Console.Out)));
        Console.SetError(TextWriter.Synchronized(new AndroidIntrumentationWriter(Console.Error)));

        string assembly = File.ReadAllText($"{AppDomain.CurrentDomain.BaseDirectory}/testassembly.txt");

        Console.WriteLine($"Testing assembly \"{assembly}\"");
        Console.WriteLine($"");

        string exclude = "NotOnMac,NotWorking,ValueAdd,CAS,InetAccess,MobileNotWorking,SatelliteAssembliesNotWorking,AndroidNotWorking";

        if (IntPtr.Size == 4)
        {
            exclude += ",LargeFileSupport";
        }

        string[] args = new string[] {
            $"-labels",
            $"-exclude={exclude}",
            $"{AppDomain.CurrentDomain.BaseDirectory}/{assembly}",
        };

        Runner = new TextUI();
        Runner.Execute(args);
    }
Example #11
0
        public void PacketFactory_BuildPacket_InvalidPacketType()
        {
            TextUI        textUI        = new TextUI(true);
            PacketFactory packetFactory = new PacketFactory();

            Assert.ThrowsException <ArgumentException>(
                () => packetFactory.BuildPacket(textUI, "badPacket", ""));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TestPage"/> class.
        /// </summary>
        public TestPage()
        {
            InitializeComponent();

            _textUI          = new TextUI(new TextBlockWriter(this.ScratchArea));
            _callingAssembly = Assembly.GetCallingAssembly();
            _textRunner      = new TextRunner(_callingAssembly);
        }
Example #13
0
    public static int Main(string[] args)
    {
        var runner = new TextUI();

        runner.Execute(args);

        return(runner.Failure ? 1 : 0);
    }
Example #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestPage"/> class.
        /// </summary>
        public TestPage()
        {
            InitializeComponent();

            _textUI = new TextUI(new TextBlockWriter(this.ScratchArea));
            _callingAssembly = Assembly.GetCallingAssembly();
            _textRunner = new TextRunner(_callingAssembly);
        }
        public void WhenWorkDirectoryIsSpecified_RunSettingsIncludeIt()
        {
            var options  = new CommandLineOptions("test.dll", "--work=results");
            var settings = TextUI.MakeRunSettings(options);

            Assert.That(settings.ContainsKey("WorkDirectory"));
            Assert.AreEqual(Path.GetFullPath("results"), settings["WorkDirectory"]);
        }
Example #16
0
        public void CreateTextUI()
        {
            _reportBuilder = new StringBuilder();
            var writer  = new ExtendedTextWrapper(new StringWriter(_reportBuilder));
            var options = new NUnitLiteOptions();

            _textUI = new TextUI(writer, null, options);
        }
        public void WhenSeedIsSpecified_RunSettingsIncludeIt()
        {
            var options  = new CommandLineOptions("test.dll", "--seed=1234");
            var settings = TextUI.MakeRunSettings(options);

            Assert.That(settings.ContainsKey("RandomSeed"));
            Assert.AreEqual(1234, settings["RandomSeed"]);
        }
        public void WhenTimeoutIsSpecified_RunSettingsIncludeIt()
        {
            var options  = new CommandLineOptions("test.dll", "--timeout=50");
            var settings = TextUI.MakeRunSettings(options);

            Assert.That(settings.ContainsKey("DefaultTimeout"));
            Assert.AreEqual(50, settings["DefaultTimeout"]);
        }
Example #19
0
        public void WriteList_ValidList_NotNull()
        {
            TextUI textUI = new TextUI(true);

            textUI.WriteList(new string[] { "a", "b" });
            Assert.IsNotNull(textUI);
            return;
        }
        static void Main(string[] args)
        {
            const string resultsPath = "\\PureMVC.DotNETCF.Tests.Results.txt";

            using (TextWriter writer = new StreamWriter(new FileStream(resultsPath, FileMode.Create)))
            {
                TextUI testRunner = new TextUI(writer);
                testRunner.Execute(new string[] { "PureMVC.DotNETCF.Tests, Version=3.0.0.0" });
            }
        }
Example #21
0
    public void Active(TextUI content)
    {
        currentPage = 0;
        ChangePage();

        this.content = content;
        bookObject.SetActive(true);

        MenuManagerInGame.Instance.CloseAllMenus();
    }
Example #22
0
        public void TestListFileMissing()
        {
            var options = new ConsoleOptions("--testlist:\\badtestlistfile");

            Assert.That(options.ErrorMessages.Count, Is.EqualTo(1));
            Assert.That(options.ErrorMessages, Does.Contain("Unable to locate file: \\badtestlistfile"));
            var filter = TextUI.CreateTestFilter(options);

            Assert.That(filter, Is.EqualTo(TestFilter.Empty));
        }
Example #23
0
 public void Initialize()
 {
     this.variables  = GameObject.Find("Script").GetComponent <UIVariables>();
     this.score      = new TextUI("Score : ", 0, variables.scoreUI);
     this.cash       = new TextUI("Cash : ", 0, variables.cashUI);
     this.headshot   = new TextUI("Headshot : ", 0, variables.headshotUI);
     this.playerKill = new TextUI("Player Kill : ", 0, variables.playerKillsUI);
     this.towerKill  = new TextUI("Tower Kill : ", 0, variables.towerKillsUI);
     this.totalKill  = new TextUI("Total Kill : ", 0, variables.totalKillsUI);
 }
Example #24
0
        public void TextUI_HeaderFooterTests()
        {
            TextUI textUI = new TextUI();

            textUI.Header = "header";
            Assert.AreEqual("header", textUI.Header);
            textUI.Footer = "footer";
            Assert.AreEqual("footer", textUI.Footer);
            return;
        }
Example #25
0
        public AasxPluginResultBase ActivateAction(string action, params object[] args)
        {
            if (action == "generate-SMD")
            {
                Queue <string> logs;
                string         modeltype   = "";
                string         machineName = "";
                // To work three arguments are needed
                if (args[0] is AasxIntegrationBase.IFlyoutProvider &&
                    args[1] is Queue <string> &&
                    args[2] is string &&
                    args[3] is string)
                {
                    var fop = args[0] as IFlyoutProvider;
                    if (fop == null)
                    {
                        return(null);
                    }

                    // Flyout for the name
                    var tb = new TextBoxFlyout("Enter name:", AnyUiMessageBoxImage.Question);
                    fop.StartFlyoverModal(tb);
                    if (!tb.Result)
                    {
                        return(null);
                    }
                    machineName = tb.Text;

                    // Flyout for choosing type of simulationmodel
                    var pd = new PhysicalDialog();
                    fop.StartFlyoverModal(pd);
                    modeltype = pd.Result;
                    if (modeltype == null)
                    {
                        return(null);
                    }

                    // Gets the queue from the argument list
                    // The queue is used to be able to display log messages in the Package Explorer
                    logs = args[1] as Queue <string>;
                }
                else
                {
                    return(new AasxPluginResultBase());
                }

                TextUI ui = new TextUI(logs);
                // The host and the machine are given as arguments(2&3) by the package explorer
                ui.Start(args[2] as string, machineName, modeltype);
            }



            return(new AasxPluginResultBase());
        }
Example #26
0
 public void Setup(SubMenu _sub)
 {
     GameEventManager.GameOver += GameOver;
     parentSub = _sub;
     Pdata = GameObject.FindGameObjectWithTag("PlayerData").GetComponent<PlayerData>();
     _playerInput = FETool.findWithinChildren(gameObject, "Input/PlayerInput").GetComponent<TextUI>();
     _playerScore = FETool.findWithinChildren(gameObject, "Input/PlayerScore").GetComponent<TextUI>();
     _playerInput.text = Pdata.PROFILE.Player_Name;
     RespawnTextCmd = FETool.findWithinChildren(gameObject, "RESPAWN_CMD").GetComponent<TextUI>();
     RespawnTextHead = FETool.findWithinChildren(gameObject, "RESPAWN_HEAD").GetComponent<TextUI>();
 }
Example #27
0
        public void WriteList_NullList_ExceptionThrown()
        {
            // Arrange.
            TextUI textUI = new TextUI(true);

            string[] sArr = null;

            // Act, Assert
            Assert.ThrowsException <NullReferenceException>(() => textUI.WriteList(sArr));
            return;
        }
Example #28
0
        public void CreateTextUI()
        {
            _reportBuilder = new StringBuilder();
            var writer = new ExtendedTextWrapper(new StringWriter(_reportBuilder));
#if !SILVERLIGHT
            var options = new ConsoleOptions();
            _textUI = new TextUI(writer, options);
#else
            _textUI = new TextUI(writer);
#endif
        }
Example #29
0
        public void CreateTextUI()
        {
            _reportBuilder = new StringBuilder();
            var writer = new ExtendedTextWrapper(new StringWriter(_reportBuilder));

#if !SILVERLIGHT && !PORTABLE
            var options = new ConsoleOptions();
            _textUI = new TextUI(writer, options);
#else
            _textUI = new TextUI(writer);
#endif
        }
Example #30
0
 public void displayLeaderboard(List<UserLeaderboard> _listLb, ref TextUI[] _lines)
 {
     int _lengthLb = lbLength;
     if (_listLb.Count < _lengthLb )
     {
         Debug.LogError("There are not enough entries");
     }
     for (int i = 0; i <= _lengthLb - 1; i++)
     {
         _lines[i].text = _listLb[i].ranking + " - " + _listLb[i].userName + " - " + _listLb[i].userBestScore;
     }
 }
Example #31
0
        public void PacketFactory_BuildPacket_DateRangePacket_Normal()
        {
            InputController.EnableMock();
            InputController.AddMockInput(SampleID);

            TextUI        textUI        = new TextUI(true);
            PacketFactory packetFactory = new PacketFactory();

            var result = packetFactory.BuildPacket(textUI, "DateRangePacket", "", "100000001");

            Assert.IsNotNull(result);
            InputController.DisableMock();
        }
Example #32
0
 void Awake()
 {
     CGUI          = GameObject.Find("CG");
     TextUI        = GameObject.Find("Text");
     CGCanvas      = GameObject.Find("CGDisplay");
     effectManager = GetComponent <UIEffect> ();
     CGImage       = CGUI.GetComponent <Image> ();
     textContent   = TextUI.GetComponent <Text> ();
     startC        = GameObject.Find("Start").GetComponent <Text> ();
     modC          = GameObject.Find("Mod").GetComponent <Text> ();
     exitC         = GameObject.Find("Exit").GetComponent <Text> ();
     CGProcess     = 0;
 }
Example #33
0
        public void CanRunTestAndReportResults()
        {
            TextWriter writer = new StringWriter();
            TextUI textUI = new TextUI(writer);
            textUI.Execute(new string[] {
                "-test:NUnitLite.Runner.Tests.SuiteReturningDummyTestSuite"});

            string report = writer.ToString();

            string fullName = typeof(DummyTestCase).FullName + ".TheTest";
            Assert.That(report, Contains.Substring("7 Tests : 1 Errors, 1 Failures, 0 Not Run"));
            Assert.That(report, Contains.Substring(string.Format("1) TheTest ({0})" + Env.NewLine + "Simulated Failure", fullName)));
            Assert.That(report, Contains.Substring(string.Format("2) TheTest ({0})" + Env.NewLine + "System.Exception : Simulated Error", fullName)));
        }
Example #34
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("Player"))
     {
         TextUI.GetInstance().ShowText("门上锁了,若有钥匙可按Q开门");
         MatterName mn = collision.gameObject.GetComponent <MatterName>();
         //Debug.Log(mn.matterName);
         if (mn.matterName == "C")
         {
             CanOpen = true;
             //Debug.Log("CanOpen");
         }
     }
 }
Example #35
0
    public static TextUI GetInstance()
    {
        if (_instance == null)
        {
            _instance = FindObjectOfType<TextUI>();
            if (_instance == null)
            {
                GameObject go = new GameObject("TextUI");
                _instance = go.AddComponent<TextUI>();
            }

        }
        return _instance;
    }
Example #36
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            TextUI.WriteHeader(this.writer);
            TextUI.WriteRuntimeEnvironment(this.writer);

            if (!LoadTestAssembly())
            {
                writer.WriteLine("No tests found in assembly {0}", GetAssemblyName(callingAssembly));
            }
            else
            {
                Dispatcher.BeginInvoke(() => ExecuteTests());
            }
        }
Example #37
0
 public void Pause()
 {
     if (isPause == true)
     {
         Continue();
     }
     else
     {
         storage.GetComponent <AudioSource>().Pause();//暂停音乐
         PauseChoice.SetActive(true);
         Time.timeScale = 0;
         TextUI.GetInstance().ShowText("");
         isPause = true;
     }
 }
Example #38
0
        public void WriteLine_ValidFooter_IncreaseCursorPosition()
        {
            // Arrange.
            TextUI ui = new TextUI(40, 40);

            ui.Footer = "Test Footer";

            int startCursorPosition = ui.CurrentCursorPosition();

            // Act.
            int currentCursorPosition = ui.WriteLine("valid string");

            // Assert. The first Writeline should return the cursor position + 1.
            Assert.AreEqual(startCursorPosition + 1, currentCursorPosition);
        }
Example #39
0
 void Start()
 {
     if (GetComponentInChildren<OTSprite>() != null)
     {
         spr = GetComponentInChildren<OTSprite>();
     }
     if (GetComponentInChildren<OTAnimatingSprite>() != null)
     {
         animSpr = GetComponentInChildren<OTAnimatingSprite>();
     }
     if (GetComponent<TextUI>() != null)
     {
         lab = GetComponentInChildren<TextUI>();
     }
 }
Example #40
0
        private async Task RunTests()
        {
            try
            {
                var assemblySuite = runner.Load(assembly, new Dictionary <string, object>
                {
                    [FrameworkPackageSettings.NumberOfTestWorkers] = 0,
                    [FrameworkPackageSettings.SynchronousEvents]   = true,
                    [FrameworkPackageSettings.RunOnMainThread]     = true
                });
                var textUI = new TextUI(writer, reader: null, options: new NUnitLiteOptions("--workers=0"));
                textUI.DisplayHeader();
                textUI.DisplayTestFiles(new string[] { assembly.FullName });

                var results = new List <ITestResult>();

                foreach (var test in assemblySuite.Tests.SelectManyRecursive(suite => suite.Tests))
                {
                    if (test.HasChildren)
                    {
                        continue;
                    }

                    await Task.Delay(1); // Allow UI to respond

                    results.Add(runner.Run(new TextUIAdapterListener(textUI), new SingleTestCaseFilter(test)));
                }

                var result  = MergeTestResults(results);
                var summary = new ResultSummary(result);

                if (summary.ExplicitCount + summary.SkipCount + summary.IgnoreCount > 0)
                {
                    textUI.DisplayNotRunReport(result);
                }

                textUI.DisplayErrorsFailuresAndWarningsReport(result);
                textUI.DisplayRunSettings();
                textUI.DisplaySummaryReport(summary);

                OnTestRunEnded();
            }
            catch (Exception ex)
            {
                writer.WriteLine(ColorStyle.Error, "Unhandled runner exception: ");
                writer.WriteLine(ColorStyle.Error, ex.ToString());
            }
        }
Example #41
0
        public void PacketFactory_BuildPacket_ServiceCodePacket_Normal()
        {
            InputController.EnableMock();
            InputController.AddMockInput(SampleCode);
            InputController.AddMockInput(SampleID);
            InputController.AddMockInput(SampleName);
            InputController.AddMockInput(SampleFee);

            TextUI        textUI        = new TextUI(true);
            PacketFactory packetFactory = new PacketFactory();

            var result = packetFactory.BuildPacket(textUI, "ServiceCodePacket", "UPDATE_SERVICE_CODE", "100000001");

            Assert.IsNotNull(result);
            InputController.DisableMock();
        }
Example #42
0
 // Start is called before the first frame update
 void Start()
 {
     if (TextUI.Instance == null)
     {
         TextUI.Instance = this;
     }
     else
     {
         if (TextUI.Instance != this)
         {
             Destroy(TextUI.Instance.gameObject);
             TextUI.Instance = this;
         }
     }
     requireCount.text = GameManager.Instance.clearRequire.ToString();
     pickCount.text    = GameManager.Instance.Pickup.ToString();
 }
    public static void RunTests(Assembly assembly)
    {
        if (assembly == null)
            throw new ArgumentNullException("assembly");

    //    if (_tested.Contains(assembly))
      //      return;
        _tested.Add(assembly);

        using (var sw = new StringWriter())
        {
            var runner = new TextUI(sw);
            runner.Execute(new[] {"/nologo", assembly.FullName});
            var resultText = sw.GetStringBuilder().ToString();
            var assemblyName = assembly.GetName().Name;
            Presenter(assemblyName, resultText);
        }
    }
Example #44
0
    public void Setup()
    {
        initPos = gameObject.transform.localPosition;
        outPos = new Vector3 (initPos.x, initPos.y + 1f, initPos.z);

        Score = FETool.findWithinChildren(this.gameObject, "Score/SCORE_CONT").GetComponent<TextUI>();
        ScoreTxt = FETool.findWithinChildren(this.gameObject, "Score/SCORE_LAB").GetComponent<TextUI>();

        LevelTxt = FETool.findWithinChildren(this.gameObject, "LevelLabel/LVL_LABEL").GetComponent<TextUI>();
        LevelTxt._mesh.characterSize = origLabelSize;

        BestScore = FETool.findWithinChildren(this.gameObject, "BestScore/BEST_CONT").GetComponent<TextUI>();
        BestScoreTxt = FETool.findWithinChildren(this.gameObject, "BestScore/BEST_LABEL").GetComponent<TextUI>();

        GameEventManager.GameStart += GameStart;
        GameEventManager.GameOver += GameOver;
        GameEventManager.Respawn += Respawn;
    }
Example #45
0
 public string TranslateSingle(TextUI _txt)
 {
     string result = _txt.text;
     if (translateGame == true && _txt.dontTranslate != true)
     {
         if ( translated_texts != null && translated_texts.ContainsKey(_txt.DIALOG_ID) != false && _txt.DIALOG_ID != null)
         {
             result = translated_texts[_txt.DIALOG_ID];
             _txt.hasBeenTranslated = true;
         }
         else
         {
             Debug.Log(_txt.gameObject.name + "/" +  _txt.DIALOG_ID + " couldn't be foundSINGLE");
             _txt.hasBeenTranslated = false;
             result = "NOT FOUND";
         }
     }
     return (result);
 }
Example #46
0
    // Use this for initialization
    void Start()
    {
        base.Setup();

        if (GameObject.FindGameObjectWithTag("PlayerData") == null)
        {
            GameObject _dataplayer = Instantiate(Resources.Load("Presets/PlayerData")) as GameObject;
            _profile = _dataplayer.GetComponent<PlayerData>();
            _profile.Launch();
        }
        else
        {
            _profile = GameObject.FindGameObjectWithTag("PlayerData").GetComponent<PlayerData>();
            _profile.Launch();
        }

        BuyBtn = FETool.findWithinChildren(gameObject, "Buy").GetComponent<MiscButton>();
        FeedBtn = FETool.findWithinChildren(gameObject, "Feedback").GetComponent<MiscButton>();
        ReturnBtn = FETool.findWithinChildren(gameObject, "ReturnHome").GetComponent<MiscButton>();
        EndAlpha = FETool.findWithinChildren(gameObject, "END_ALPHA").GetComponent<TextUI>();
        EndDemo = FETool.findWithinChildren(gameObject, "END_DEMO").GetComponent<TextUI>();

        if (_profile.SETUP.GameType == GameSetup.versionType.Alpha)
        {
            EndDemo.color = Color.clear;
        }
        if (_profile.SETUP.GameType == GameSetup.versionType.Demo)
        {
            EndAlpha.color = Color.clear;

        }
        SubMenu _sub = GetComponent<SubMenu>();
        _sub.SetupSub(this);
        _sub.setupBtn();
        currentActiveMenu = _sub;
        currFocusedbtn = _sub.menuButtons[0];
        _sub.menuButtons[0].giveFocus(true);
        InvokeRepeating("checkPadMenu", 0f, 0.5f);

        TranslateAllInScene();
    }
Example #47
0
 public void TranslateAll(ref TextUI[] _arrTxt)
 {
     if (translateGame == true)
     {
         foreach (TextUI _tx in _arrTxt)
         {
             if (translated_texts.ContainsKey(_tx.DIALOG_ID) != false && _tx.dontTranslate == false)
             {
                 _tx.text = translated_texts[_tx.DIALOG_ID];
                 _tx.hasBeenTranslated = true;
             }
             else
             {
                 if (_tx.dontTranslate == false)
                 {
                     Debug.Log(_tx.gameObject.name + "/" +  _tx.DIALOG_ID + " couldn't be foundALL");
                     _tx.text = "NOT FOUND";
                     _tx.hasBeenTranslated = false;
                 }
             }
         }
     }
 }
Example #48
0
    // Use this for initialization
    public void Setup(LevelManager _lev)
    {
        levMan = _lev;

        NotifPop = FETool.findWithinChildren(gameObject ,"Ingame/Panels/NotifObj").GetComponent<PopUp>();
        NotifPop.Setup();
        NotifPop.Fade();

        HandClock = FETool.findWithinChildren(gameObject, "Ingame/Panels/Clock/Aiguille").GetComponentInChildren<OTSprite>();
        FoodState = FETool.findWithinChildren(gameObject, "Ingame/Panels/PanFood/Bar").GetComponentInChildren<OTSprite>();
        SleepState = FETool.findWithinChildren(gameObject, "Ingame/Panels/PanSleep/Bar").GetComponentInChildren<OTSprite>();
        Controls = FETool.findWithinChildren(gameObject, "Ingame/Controls").GetComponentInChildren<OTSprite>();

        dialogPop = FETool.findWithinChildren(gameObject, "Ingame/Dialog").GetComponent<PopUp>();
        WillBack = FETool.findWithinChildren(gameObject, "Ingame/Dialog/WillBeBack").GetComponentInChildren<OTSprite>();
        WillBackTxt = FETool.findWithinChildren(gameObject, "Ingame/Dialog/WillBeBack").GetComponentInChildren<TextUI>();
        OtherText = FETool.findWithinChildren(gameObject, "Ingame/Dialog/OtherText").GetComponentInChildren<TextUI>();
        dialogPop.Setup();

        VictoryGO = FETool.findWithinChildren(gameObject, "Ingame/Victory");
        DeathGO = FETool.findWithinChildren(gameObject, "Ingame/Death");
        StartGO = FETool.findWithinChildren(gameObject, "Ingame/Start");
        TitleGO = FETool.findWithinChildren(gameObject, "Ingame/Title");

        StartCoroutine("fadeControls");
        //		dialogPop.Fade();

        Paper = FETool.findWithinChildren(gameObject, "Ingame/Paper/SeekPaper").GetComponentInChildren<OTSprite>();
        paperText = FETool.findWithinChildren(gameObject, "Ingame/Paper/State").GetComponentInChildren<TextUI>();

        Clock = FETool.findWithinChildren(gameObject, "Ingame/Panels/Clock/Hours").GetComponent<TextUI>();
        DarkBG = FETool.findWithinChildren(gameObject, "Ingame/Black").GetComponentInChildren<OTSprite>();

        UIBtn[] listBtn = GetComponentsInChildren<UIBtn>();
        foreach ( UIBtn btn in listBtn)
        {
            btn.Setup(this);
        }

        GameEventManager.GameOver += GameOver;
        GameEventManager.Respawn += Respawn;
        GameEventManager.GameStart += GameStart;
        GameEventManager.EndGame += EndGame;
    }
Example #49
0
 public void Setup(LevelInfo _currLvl)
 {
     Objective = FETool.findWithinChildren(gameObject, "OBJECTIVE").GetComponent<TextUI>();
     _lvlNameDisp = FETool.findWithinChildren(gameObject, "LEVEL_NAME").GetComponent<TextUI>();
     _lvlNameDisp.text = _currLvl.LvlName.ToString();
 }
Example #50
0
 // Use this for initialization
 public void Setup()
 {
     switch ( PopType)
     {
         case PopTypeList.Dialog :
         {
             DraculaPic = FETool.findWithinChildren(gameObject, "DraculaPic").GetComponentInChildren<OTSprite>();
             JohnPic = FETool.findWithinChildren(gameObject, "JohnPic").GetComponentInChildren<OTSprite>();
             OutPic = FETool.findWithinChildren(gameObject, "WillBeBack").GetComponentInChildren<OTSprite>();
             helpTxt = FETool.findWithinChildren(gameObject,"Help").GetComponent<TextUI>();
             break;
         }
         case PopTypeList.NotifHour :
         {
             break;
         }
     }
     BG = FETool.findWithinChildren(gameObject, "BG").GetComponentInChildren<OTSprite>();
     linkText = FETool.findWithinChildren(gameObject,"Text").GetComponent<TextUI>();
 }
Example #51
0
    void Awake()
    {
        Screen.SetResolution(1366,768, false);
        name = "TitleMenu";
        base.Setup();
        SETUP = Resources.Load ("Tuning/GameSetup") as GameSetup;
        Chooser = FETool.findWithinChildren(gameObject, "LevelChooser").GetComponent<LevelChooser>();
        SETUP.startTranslate(SETUP.ChosenLanguage);
        SETUP.translateSceneText();
        levelInformations = new List<LevelInfo> ();

        if (GameObject.Find("Frameworks") == null)
        {
            GameObject fmObj = Instantiate(Resources.Load("Presets/Frameworks")) as GameObject;
            fmObj.name = "Frameworks";
        }

        Chooser.Setup ();
        awayPlace = FETool.findWithinChildren(gameObject, "AwayPlace");
        frontPlace = FETool.findWithinChildren(gameObject, "FrontPlace");
        Credits = FETool.findWithinChildren(gameObject, "Credits").GetComponent<SubMenu>();
        Landing = FETool.findWithinChildren(gameObject, "Landing").GetComponent<SubMenu>();
        LevelChooser = FETool.findWithinChildren(gameObject, "LevelChooser").GetComponent<SubMenu>();
        Options = FETool.findWithinChildren(gameObject, "Options").GetComponent<SubMenu>();
        versionDisplay = FETool.findWithinChildren(gameObject, "Landing/Underpanel/GAME_VERSION").GetComponent<TextUI>();

        SubMenu[] subMn = GetComponentsInChildren<SubMenu>();
        foreach (SubMenu sub in subMn)
        {
            sub.SetupSub(this);
            sub.setupBtn();
        }
        if (Input.GetJoystickNames().Length > 0)
        {
            padEntered = true;
            changeState(MenuStates.Start);
        }
        versionDisplay.TranslateThis();
        InvokeRepeating("checkPadMenu", 0f, 0.5f);
        TranslateAllInScene();
        versionDisplay.text += SETUP.gameversion;
        GameEventManager.TriggerGameStart("MainTitle");
        //		StartCoroutine("DelayMusic");
    }
Example #52
0
    // Use this for initialization
    public void Setup(LevelManager _lev)
    {
        coneParent = FETool.findWithinChildren(gameObject, "ParentCone");
        gameSprite = FETool.findWithinChildren(gameObject, "Sprite");
        bubble = FETool.findWithinChildren(gameObject, "Bubble").GetComponentInChildren<OTSprite>();
        levMan = _lev;
        initpos = transform.position;

        RayDL = FETool.findWithinChildren(gameObject, "RayOrigin_DL").transform;
        RayUL = FETool.findWithinChildren(gameObject, "RayOrigin_DR").transform;
        RayDR = FETool.findWithinChildren(gameObject, "RayOrigin_UL").transform;
        RayUR = FETool.findWithinChildren(gameObject, "RayOrigin_UR").transform;

        paper = FETool.findWithinChildren(gameObject, "Paper").GetComponentInChildren<OTSprite>();
        papertxt = FETool.findWithinChildren(gameObject, "Paper").GetComponentInChildren<TextUI>();
        papertxt.color = Color.clear;

        spr = GetComponentInChildren<OTAnimatingSprite>();
        spr.Play("static");

        coneCollider = coneParent.GetComponentInChildren<BoxCollider>();
        coneRenderer = coneParent.GetComponentInChildren<LineRenderer>();
        halfMyY = 0.25f;

        bubble.alpha = 0f;

        GameEventManager.GameOver += GameOver;
        GameEventManager.Respawn += Respawn;
        GameEventManager.GameStart += GameStart;
        GameEventManager.EndGame += EndGame;
    }