Esempio n. 1
0
        public void MutantService_IsDnaValid_OneInvalidWhiteSpaceInTheMiddle_Fails()
        {
            //Arrange
            MutantService service = GetMutantService();

            string[] dna = { "AGT", "A C", "CCW" }; //==> " " is invalid

            //Action & Asserts
            Assert.ThrowsException <DnaInvalidException>(() => service.IsDnaValid(dna));
        }
Esempio n. 2
0
        public void MutantService_IsDnaValid_OneInvalidLetterAtTheEnd_Fails()
        {
            //Arrange
            MutantService service = GetMutantService();

            string[] dna = { "AGT", "ATC", "CCW" }; //==> W is invalid

            //Action & Asserts
            Assert.ThrowsException <DnaInvalidException>(() => service.IsDnaValid(dna));
        }
Esempio n. 3
0
        public void MutantService_IsDnaValid_DnaNxM_Fails()
        {
            //Arrange
            MutantService service = GetMutantService();

            string[] dna = { "AGA", "AT", "CCT" };

            //Action & Asserts
            Assert.ThrowsException <DnaInvalidException>(() => service.IsDnaValid(dna));
        }
Esempio n. 4
0
        public void MutantService_IsDnaValid_DnaInNull_Fails()
        {
            //Arrange
            MutantService service = GetMutantService();

            string[] dna = null;

            //Action & Asserts
            Assert.ThrowsException <DnaInvalidException>(() => service.IsDnaValid(dna));
        }
Esempio n. 5
0
        public void MutantService_IsDnaValid_ValidDna4x4_Succeeds()
        {
            //Arrange
            MutantService service = GetMutantService();

            string[] dna = { "AGTA", "ATCA", "ACCA", "TGAC" };

            //Action
            bool result = service.IsDnaValid(dna);

            //Asserts
            Assert.IsTrue(result);
        }
Esempio n. 6
0
        public void MutantService_IsDnaValid_ValidDna5x5_Succeeds()
        {
            //Arrange
            MutantService service = GetMutantService();

            string[] dna =
            {
                "AGATT",
                "TATGC",
                "CCAGT",
                "AACGT",
                "CCGGT"
            };

            //Action
            bool result = service.IsDnaValid(dna);

            //Asserts
            Assert.IsTrue(result);
        }