Example #1
0
        public ReturnedObject insertText(string publicKey, string privateKey, Text text)
        {
            ReturnedObject returnedObject = new ReturnedObject();

            if (Security.authorizeClient(publicKey, privateKey))
            {
                CtrText _CtrText = new CtrText();
                returnedObject.code = _CtrText.insertText(text);
            }
            else
            {
                returnedObject.code = (int)CODE.CLIENT_NOT_AUTHORIZED;
            }
            return(returnedObject);
        }
Example #2
0
        //LAYER_Class_NameOfTheMethod_TestedScenario_ExpectedBehaviour
        public void BLL_CtrText_InsertText_InsertText_TextIsInserted()
        {
            //arrange
            int    textId   = 1;
            string textData = "Test text to be inserted";

            Text text_m1 = new Text(
                textId,
                textData
                );
            CtrText _CtrText = new CtrText();

            //act
            int result = _CtrText.insertText(text_m1);

            //assert

            Assert.IsTrue(result >= (int)ENUM.CODE.TRANSLATO_DATABASE_SEED, "text not inserted");
        }