Exemplo n.º 1
0
        private string RegistrateSummary()
        {
            var name = _namesGenerator.GetRandomName();

            _collection.Add(new MetricDefinition <Summary>(name, Metrics.CreateSummary(name, _namesGenerator.GetRandomName())));
            return(name);
        }
Exemplo n.º 2
0
 public Room()
 {
     NumberOfDoors   = 1;
     NumberOfWindows = 1;
     Area            = 0;
     ID   = Guid.NewGuid();
     Name = namesGenerator.GetRandomName();
 }
    public void EndGame()
    {
        Cursor.lockState = CursorLockMode.None;
        Cursor.visible   = true;
        statisticsUI.SetActive(true);
        string name = NamesGenerator.GetRandomName();

        int    timeOnGroundMins = (int)Mathf.Floor(timeOnGround / 60);
        float  timeOnGroundSecs = timeOnGround - 60.0f * timeOnGroundMins;
        string timeOnGroundStr  = "Ground time: " + timeOnGroundMins + "m " + timeOnGroundSecs.ToString("0.##") + "s";

        int    timeMins     = (int)Mathf.Floor(totalTime / 60);
        float  timeSecs     = totalTime - timeMins * 60.0f;
        string totalTimeStr = "Time: " + timeMins + "m " + timeSecs.ToString("0.##") + "s";

        string highScoreString = "Look for a high score with the name " + name + "!";

        statisticsUI.GetComponentInChildren <Text>().text = timeOnGroundStr + "\n" + totalTimeStr + "\n" + highScoreString;
        SubmitHighScore(totalTime, timeOnGround, name);
    }
Exemplo n.º 4
0
        public ChaosMonkeyException()
        {
            var generator = new NamesGenerator();

            MonkeyName = generator.GetRandomName();
        }
Exemplo n.º 5
0
        public void NamesGenerator_GetRandomName()
        {
            var val = NamesGenerator.GetRandomName();

            Assert.True(!string.IsNullOrEmpty(val));
        }
        public void PrometheusMetricsRegistry_RegistrateCounter_RegistrateDefinition()
        {
            // Arrange
            var sut    = CreateSUT();
            var metric = Metrics.CreateCounter(_namesGenerator.GetRandomName(), _namesGenerator.GetRandomName(), new string[] { _namesGenerator.GetRandomName() });

            // Act
            sut.RegistrateCounter(metric);

            // Assert
            Assert.Contains((IEnumerable <MetricDefinition <Counter> >)_collection, m => m.Key.Equals(metric.Name) && m.Metric == metric);
        }