Beispiel #1
0
        public void AddDocumentToDb_ExpectedParameters_Ok()
        {
            documentDataAccess.Add(document);

            Document obtained = documentDataAccess.Get(document.Id);

            Assert.AreEqual(document, obtained);
        }
        public string GenerateHTML(Guid document, Guid format)
        {
            if (!DocumentDataAccess.Exists(document))
            {
                throw new ArgumentException("The document argument not exist in database."
                                            , "document");
            }

            if (!FormatDataAccess.Exists(format))
            {
                throw new ArgumentException("The format argument not exist in database."
                                            , "format");
            }

            HtmlGenerator Printer = new HtmlGenerator();

            Document doc  = DocumentDataAccess.Get(document);
            Format   form = FormatDataAccess.Get(format);

            return(Printer.Generate(doc, form));
        }
        public bool AreEqual(Guid firstDocumentId, Guid secondDocumentId)
        {
            if (!documentDataAccess.Exists(firstDocumentId))
            {
                throw new ArgumentException("The first document argument not exist in database."
                                            , "firstDocumentId");
            }
            if (!documentDataAccess.Exists(secondDocumentId))
            {
                throw new ArgumentException("The second document argument not exist in database."
                                            , "secondDocumentId");
            }

            Document firstDocument  = documentDataAccess.Get(firstDocumentId);
            Document secondDocument = documentDataAccess.Get(secondDocumentId);

            return(firstDocument.Equals(secondDocument));
        }