public void ExistDocumentInDb_ExpectedParameters_Ok() { documentDataAccess.Add(document); bool exists = documentDataAccess.Exists(document.Id); Assert.IsTrue(exists); }
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 void AddDocument(Document newDocument) { if (documentDataAccess.Exists(newDocument.Id)) { throw new DuplicateWaitObjectException("newDocument.Id" , "The Document you want to enter already exists in the database."); } documentDataAccess.Add(newDocument); }