public bool AreEqual(Guid firstTextId, Guid secondTextId)
        {
            if (!textDataAccess.Exists(firstTextId))
            {
                throw new ArgumentException("The first text argument not exist in database."
                                            , "firstTextId");
            }
            if (!textDataAccess.Exists(secondTextId))
            {
                throw new ArgumentException("The second text argument not exist in database."
                                            , "secondTextId");
            }

            Text firstText  = textDataAccess.Get(firstTextId);
            Text secondText = textDataAccess.Get(secondTextId);

            return(firstText.Equals(secondText));
        }
Esempio n. 2
0
        public void DeleteMarginFromDb_ExpectedParametersAndTextToDelete_Ok()
        {
            margin.SetText(aText);
            marginDataAccess.Add(margin);

            marginDataAccess.Delete(margin.Id);

            Margin obtained     = marginDataAccess.Get(margin.Id);
            Text   textObtained = textDataAccess.Get(aText.Id);

            Assert.IsNull(obtained);
        }
Esempio n. 3
0
        public void DeleteParagraphFromDb_ExpectedParametersAndTextToDelete_Ok()
        {
            paragraph.PutTextAtLast(aText);
            paragraphDataAccess.Add(paragraph);

            paragraphDataAccess.Delete(paragraph.Id);

            Paragraph obtained     = paragraphDataAccess.Get(paragraph.Id);
            Text      textObtained = textDataAccess.Get(aText.Id);

            Assert.IsNull(obtained);
            Assert.IsNull(textObtained);
        }
        public void AddTextToDb_ExpectedParameters_Ok()
        {
            textDataAccess.Add(text);

            Text obtained = textDataAccess.Get(text.Id);

            Assert.AreEqual(text, obtained);
        }