public void ShouldReturnShortViewBook() { var book = new Book { Title = "Book", Summary = "A new book", PurchaseUrl = "www.purchasebook.com" }; var bookLongView = new ShortView(new BookResource(book)); Assert.AreEqual($"Short View - {book.Title} | {book.Summary} | {book.PurchaseUrl}", bookLongView.Show()); }
private static void Bridge() { var song = new Song("jimikki kammal", "Velipadinte pusthakam song", "Photo is here ***** "); var movie = new Movie("Velipadinte pusthakam", "Mohanlal and Lal jose for the first time together", "Photo ***** "); var longView = new LongView(); Console.WriteLine("Displaying on a long view"); longView.DisplayOnMonitor(song, movie); var shortView = new ShortView(); Console.WriteLine("Displaying on a short view"); shortView.DisplayOnMonitor(song, movie); }
static void Main(string[] args) { // Creating arist resource var artist = new Artist() { Image = "drunkInGreatCanyon.jpeg", Name = "Bruce Springsteen" }; var artistResource = new ArtistResoruce(artist); // Creating book resource var book = new Book() { Author = "Camus", Description = " published in 1947, that tells the story of suffering", Genre = "Philosophy", Image = "drunkInChurch.jpeg" }; var bookResource = new BookResource(book); // Creating some types of views var longArtistView = new LongView(artistResource); var shortArtistView = new ShortView(artistResource); var longBookView = new LongView(bookResource); var shortBookView = new ShortView(bookResource); var views = new IView[] { longArtistView, shortArtistView, longBookView, shortBookView }; foreach (var view in views) { // returns string view.Show().Print(); } Console.Read(); }