コード例 #1
0
        public void CanANewContentBeCreated()
        {
            Content a = new Content()
            {
                contentid   = 99,
                headerimage = "Some image from test",
                tabimage    = "Some Name from test",
                slug        = "new-post-from-test",
                body        = "some awesome tesx",
                title       = "some title added from test",
                authorid    = 1,
            };

            _testRepo.Add(a);

            var insertedContent = _testRepo.FindAll().Where(w => w.slug == a.slug).First();

            _testid = insertedContent.contentid;
            Assert.AreEqual(a.slug, insertedContent.slug);
        }
コード例 #2
0
 public void AddContent([FromBody] Content data)
 {
     ContentRepo.Add(data);
     _log.LogInformation($"The Content that is added {JsonConvert.SerializeObject(data)}");
 }