Ejemplo n.º 1
0
        //LAYER_Class_NameOfTheMethod_TestedScenario_ExpectedBehaviour
        public void MODEL_Language_FullConstructor_CreateLanguage_LanguageIsCreated()
        {
            //arrange
            int languageId = 1;
            string languageName = "Lithuanian";

            //act
            Language language_m1 = new Language(
                 languageId,
                 languageName
                 );

            //assert
            Assert.IsNotNull(language_m1, "language object is null");
            Assert.AreEqual(1, language_m1.languageId, "wrong languageId");
            Assert.AreEqual("Lithuanian", language_m1.languageName, "wrong languageName");
        }
Ejemplo n.º 2
0
        //LAYER_Class_NameOfTheMethod_TestedScenario_ExpectedBehaviour
        public void DAL_ILanguage_InsertLanguage_InsertLanguage_LanguageIsInserted()
        {
            //arrange
            int languageId = 1;
            string languageName = "English";
            Language language_m1 = new Language(
                languageId,
                languageName
                );
            ILanguages _DbLanguages = new DbLanguages();

            //act
            int result = _DbLanguages.insertLanguage(language_m1);

            //assert
            Assert.IsTrue(result>=(int)ENUM.CODE.TRANSLATO_DATABASE_SEED,"language not inserted");
        }
Ejemplo n.º 3
0
        //LAYER_Class_NameOfTheMethod_TestedScenario_ExpectedBehaviour
        public void MODEL_Language_SetAndGetMethods_ModifyAllFieldsValues_AllValuesAreModified()
        {
            //arrange
            int languageId = 1;
            string languageName = "Lithuanian";
            Language language_m2 = new Language(
                languageId,
                languageName
                );

            //act
            language_m2.languageId = 2;
            language_m2.languageName = "Romanian";

            //assert
            Assert.IsNotNull(language_m2, "language object is null");
            Assert.AreEqual(2, language_m2.languageId, "languageId not changed");
            Assert.AreEqual("Romanian", language_m2.languageName, "languageName not changed");
        }