예제 #1
0
        public void CSV_file_is_read_correct()
        {
            var result = ContentLibrary.ImportFromCsvFile("content\\Tweets.csv");

            result.Should().Contain(c => c.Message == "äöü" && c.Link == "http://das.ist.toll");
            result.Should().Contain(c => c.Message == "Hello World" && c.Link == "https://link.de");
        }
예제 #2
0
        public void Should_not_have_published_timestamps()
        {
            var result = ContentLibrary.ImportFromCsvFile("content\\Tweets.csv");

            result.Should().NotContain(c => c.PublishedAt != new DateTime());
        }
예제 #3
0
        public void Should_not_have_published_ids()
        {
            var result = ContentLibrary.ImportFromCsvFile("content\\Tweets.csv");

            result.Should().NotContain(c => !string.IsNullOrEmpty(c.PublishedId));
        }
예제 #4
0
        public void Should_all_be_unpublished()
        {
            var result = ContentLibrary.ImportFromCsvFile("content\\Tweets.csv");

            result.Should().NotContain(c => c.IsPublished);
        }
예제 #5
0
        public void Ids_are_unique()
        {
            var result = ContentLibrary.ImportFromCsvFile("content\\Tweets.csv");

            result.Select(c => c.Id).Should().OnlyHaveUniqueItems();
        }
예제 #6
0
        public void Importing_from_CSV_file_sets_the_ids_on_each_content()
        {
            var result = ContentLibrary.ImportFromCsvFile("content\\Tweets.csv");

            result.Should().NotContain(c => string.IsNullOrEmpty(c.Id));
        }
예제 #7
0
        public void ImportContent()
        {
            var contents = ContentLibrary.ImportFromCsvFile(CsvFilename);

            ContentLibrary.SaveAsJsonFile(contents, ContentLibraryFilename);
        }