private static void Like(StackOverflowPost post) { post.PostLike(1); post.PostLike(1); post.PostLike(1); post.PostDislike(1); post.PostDislike(1); }
static void Main(string[] args) { var post = new StackOverflowPost(); Title(post); Description(post); CreationDate(post); Like(post); Console.WriteLine("Title: {0}\n" + "Description: {1}\n" + "Created on {2}\n" + "{3} people liked your post\n" + "{4} disliked your post\n", post.Title, post.Description, post.CreationDate, post.Like, post.Dislike); }
static void Main(string[] args) { var post = new StackOverflowPost(); post.Title = "Hello, this is my first post!"; post.Description = "I am just practing C# fundemantals"; post.DateTimeCreated = DateTime.Now; post.displayPost(); var repeat = true; while (repeat) { Console.WriteLine($@" Enter Y to up-vote the post Enter N to down-vote the post Enter View to view the post detail Enter other keys to kill this stupid app :) "); var userInput = Console.ReadLine().ToUpper(); if (userInput == "Y") { post.UpVote(); } else if (userInput == "N") { post.DownVote(); } else if (userInput == "VIEW") { post.displayPost(); } else { repeat = false; } } }
private static void CreationDate(StackOverflowPost post) { post.PostCreation(DateTime.Now); }
private static void Description(StackOverflowPost post) { post.PostDescription("This is an intermediate level course"); }
private static void Title(StackOverflowPost post) { post.PostTitle("Welcome to my C# Course"); }