Example #1
0
        public ColorsModel GetNeutralColor()
        {
            Color[] wordsColors = _colorRepository.GetColors();

            int wordIndex = _randomGenerator.GetRandomInt(0, wordsColors.Length);

            Color randomColor = wordsColors[wordIndex];

            return(new ColorsModel()
            {
                ColorAsWord = randomColor,
                ColorAsHex = Color.BLACK.ToHex()
            });
        }
        public async Task <IActionResult> GetColors()
        {
            List <Color> colors = await _repo.GetColors();

            // HTTP 200 response Ok
            return(Ok(colors));
        }
        public void ReturnArrayOfColor_WhenGetColorsIsCalled()
        {
            // Arrange
            // Act
            var actual = _colorRepository.GetColors();

            // Assert
            Assert.NotNull(actual);
            Assert.IsType <Color[]>(actual);
        }