Exemple #1
0
        public void GivenAnXmlFile_WhenITryToSaveToTheDatabase_ItIsSavedToTheDatabase()
        {
            int initialCount = _xmlFileRepository.Entities.Count();

            _xmlFileRepository.Create(_xmlFile1);
            _xmlFileRepository.Entities.Count().Should().Be(initialCount + 1);
        }
        public void GivenDocuments_WhenISearchForApprovedAndNonExportedForOffShore_IGetTheCorrectDocuments()
        {
            _xmlFileRepository.Create(_xmlFileOffShore);
            _xmlFileRepository.Create(_xmlFileOnShore);

            var documents = _documentRepository.GetApprovedAndNotExported(true);

            documents.Should().NotContain(d => d.DocumentId == "id7")
            .And.Contain(d => d.DocumentId == "id")
            .And.Contain(d => d.DocumentId == "id2")
            .And.NotContain(d => d.DocumentId == "id3")
            .And.NotContain(d => d.DocumentId == "id4")
            .And.NotContain(d => d.DocumentId == "id5")
            .And.NotContain(d => d.DocumentId == "id6")
            .And.NotContain(d => d.DocumentId == "id8");
        }
        public static void CreateScriptXml(int index = 0)
        {
            var cmdLet   = CreateCmdLet(index);
            var fileName = @"Files\Scripts.xml";
            var rep      = new XmlFileRepository <CmdLet, Guid>();

            rep.Initialize(fileName);
            rep.Create(cmdLet);
        }