public void MatrixContainsInvalidCharacters()
        {
            string[] mutantExample = new string[] { "ATGCGA", "CAGTGC", "TTATZT", "AGAAGG", "CCCCTA", "TCACTZ" };

            var containsInvalidCharacters = MatrixUtils.ContainsInvalidCharacters(mutantExample, validCharacters);

            Assert.IsTrue(containsInvalidCharacters);
        }
예제 #2
0
        public ActionResult Mutant(RequestDto request)
        {
            var dna = request.dna;

            if (!MatrixUtils.IsSquareMatrix(dna) || MatrixUtils.ContainsInvalidCharacters(dna, validCharacters))
            {
                return(BadRequest());
            }

            if (mutantsIdentificationService.IsMutant(dna, DateTime.Now))
            {
                return(new OkResult());
            }
            else
            {
                return(new StatusCodeResult(403));
            }
        }
        public void MatrixContainsValidCharacters()
        {
            var containsInvalidCharacters = MatrixUtils.ContainsInvalidCharacters(mutantExample, validCharacters);

            Assert.IsFalse(containsInvalidCharacters);
        }