public void Add_blog() { var blog = new Blog { Title = "newBlog" }; var count = _repository.Blogs.Count(); _repository.AddBlog(blog); Assert.AreEqual(count + 1, _repository.Blogs.Count()); Assert.AreEqual("newBlog", _repository.Blogs.Single(p => p.Title == "newBlog").Title); }
/// <summary> /// Create a new Blog object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="title">Initial value of the Title property.</param> /// <param name="isVisible">Initial value of the IsVisible property.</param> /// <param name="key">Initial value of the Key property.</param> public static Blog CreateBlog(global::System.Int32 id, global::System.String title, global::System.Int16 isVisible, global::System.String key) { Blog blog = new Blog(); blog.Id = id; blog.Title = title; blog.IsVisible = isVisible; blog.Key = key; return blog; }
/// <summary> /// Deprecated Method for adding a new object to the Blogs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToBlogs(Blog blog) { base.AddObject("Blogs", blog); }
public void Delete_blog_with_Id_1() { var blog = new Blog { Id = 1 }; _repository.DeleteBlog(blog); Assert.AreEqual(BlogStatus.Invisible, _repository.Blogs.WithId(1).IsVisible); }