示例#1
0
        public void ShoulImportData()
        {
            var groupRep = new GroupDbRepository();

            var group = new ArticleGroup
            {
                GroupName = "Федя"
            };

            var id = groupRep.Save(group);


            var str = "<XmlArticle><Article Link=\"http://ontime.spanishpoint.ie/\" AuthorName=\"Хабр\" ArticleName=\"Федя\" ArticleId=\"1\" GroupId=\"{0}\" InitialText=\"Федя\"></Article></XmlArticle>".Fmt(id);

            rep.Import(true, str.GetBytes());

            var actual = rep.GetByPredicate(c => c.ArticleName == "Федя", new QueryParams <Article>(0, 10, x => x.ArticleId)).FirstOrDefault();


            actual.Should(Be.Not.Null);
            actual.ArticleGroup.Should(Be.Not.Null);
        }
        public void ShoulImportData()
        {
            var groupRep = new GroupDbRepository();

            var group = new ArticleGroup
            {
                GroupName = "Федя"
            };

            var id = groupRep.Save(group);

            var str = "<XmlArticle><Article Link=\"http://ontime.spanishpoint.ie/\" AuthorName=\"Хабр\" ArticleName=\"Федя\" ArticleId=\"1\" GroupId=\"{0}\" InitialText=\"Федя\"></Article></XmlArticle>".Fmt(id);
            rep.Import(true, str.GetBytes());

            var actual = rep.GetByPredicate(c => c.ArticleName == "Федя", new QueryParams<Article>(0, 10, x => x.ArticleId)).FirstOrDefault();

            actual.Should(Be.Not.Null);
            actual.ArticleGroup.Should(Be.Not.Null);
        }