public void MotorHome_list_should_be_created_for_motorhomes() { var car = new MotorHome(); var factory = PricingFactory.Create(); var policy = factory.GetPolicyFor(car); Assert.IsInstanceOfType(policy, typeof(MotorHomePricing)); }
public void TestMethod1() { var relatorio = "Tipo do Carro: Motor Home\n" + "Quantidade de diárias: 2\n" + "Valor total das diárias: R$ 600\n" + "Estimativa de quilometragem em reais: R$ 552.50\n" + "Valores de todos os adicionais: GPS: R$ 35 Geladeira: R$ 250 \n" + "Valor total do aluguel: R$ 1437.50"; var motorHome = MotorHome.Novo() .AdicionarAdicional <Gps>(35m) .AdicionarAdicional <Geladeira>(250m); var dataSaida = new DateTime(2019, 10, 21); var dataRetorno = new DateTime(2019, 10, 23); var aluguel = new Aluguel(dataSaida, dataRetorno, motorHome, 850); var result = Relatorio.Imprimir(aluguel); Assert.AreEqual(result, relatorio); }
static void Main(string[] args) { ////then test the class you created in TesterProgram by creating objects using both constructors and writing them to the screen. Student s1 = new Student(); s1.FirstName = "Elizardbreath"; s1.LastName = "Needs Ham"; s1.ID = "1234"; s1.GPA = 3.6f; Console.WriteLine($"Student first name: {s1.FirstName}\nStudent last name: {s1.LastName}\nStudent ID: {s1.ID}\nStudent GPA: {s1.GPA}"); Student s2 = new Student(); Console.WriteLine(s2); Vehicle v1 = new Vehicle(); v1.Make = "Subaru"; v1.Model = "Forester"; v1.Year = 2018; v1.Weight = 2000; Vehicle v2 = new Vehicle(); Console.WriteLine($"Car make: {v1.Make}\nCar Model: {v1.Model}\nCar year: {v1.Year}\nCar Weight: {v1.Weight}"); Console.WriteLine(v2); Login l1 = new Login(); l1.Username = "******"; l1.Password = "******"; Login l2 = new Login(); Console.WriteLine($"Username: {l1.Username}\nPassword: {l1.Password}"); Console.WriteLine(l2); ContactInfo c = new ContactInfo(); c.StreetAddress = "brain broke"; c.City = "brain brok"; c.State = "brain bro"; c.Zip = "brain br"; c.Phone = "brain b"; c.Email = "brain "; ContactInfo c2 = new ContactInfo(); Console.WriteLine($"{c.StreetAddress}\n{c.City}\n{c.State}\n{c.Zip }\n{c.Phone}\n{c.Email}"); Console.WriteLine(c2.StreetAddress); //what is it supposed to look like when I print out the thing I made with the default method??? Customer cust1 = new Customer(); cust1.CustomerId = "who cares"; cust1.FirstName = "Elizardbreath"; cust1.LastName = "Needsham"; cust1.ContactInformation = c; Console.WriteLine($"{cust1.CustomerId}\n{cust1.FirstName}\n {cust1.LastName}\n{cust1.ContactInformation}"); //here I was making it more difficult than it was - Once I assigned the values to the fields of the customer all I had to do was the linebelow and all the customer info is printed out Console.WriteLine(cust1); Customer cust2 = new Customer(); Console.WriteLine(cust2); CreditCardAccount a = new CreditCardAccount(13545, cust1, 1000, false, 4); Console.WriteLine("\n" + a); CreditCardAccount b = new CreditCardAccount(); Console.WriteLine("\n" + b); Book book1 = new Book("Stuff White People Like", "Christian Lander", 211); Console.WriteLine(book1); Book book2 = new Book(); book2.Title = "Lord of the Rings"; //Console.WriteLine(book2); List <Book> books = new List <Book>(); books.Add(book1); books.Add(book2); //Console.WriteLine(books); Library lib1 = new Library(books, "Plaza Branch", " 50000 Holmes st", "KC", "MO", "65454"); Console.WriteLine(lib1); //it's not writing the books out here..... //Library lib2 = new Library(); //Console.WriteLine(lib2); ////TODO get help with why this isn't printing off the empty properties or whatever Song song1 = new Song("Billy Joel", "some billy joel song", 546545); Console.WriteLine(song1); Song song2 = new Song(); Console.WriteLine(song2); Song[] songs = { song1, song2 }; //foreach (Song song in songs) //{ // Console.WriteLine(song); //} Artist artist1 = new Artist(songs, "Billy Joel", "random genre"); Console.WriteLine(artist1); //Artist artist2 = new Artist(); //Console.WriteLine(artist2); //TODOgetting error messages for the classes that have lists in them as properties - they won't print off if no value is passed to them I just get an error msg on the consol MotorHome minnieWinnie = new MotorHome("winnie", "winnie model", 1986, 54654, 5); Console.WriteLine(minnieWinnie); Truck newTruck = new Truck("Toyota", "Tundra", 1995, 2050, 500); Console.WriteLine(newTruck); }
static void Main(string[] args)//only do 1-4 8 objects total { //1) student Student transfer = new Student("Maria", "Sanchez", "3579", 3.9f); Student current = new Student(); current.FirstName = "Larry"; current.LastName = "Walters"; current.Id = "0123"; current.Gpa = 2.9f; Console.WriteLine($"{transfer}\n\n{current}\n\n"); //2) vehicle Vehicle old = new Vehicle("Chevy", "Celebrity", 1984, 2.5f); Vehicle newModel = new Vehicle(); newModel.Make = "Toyota"; newModel.Model = "Prius"; newModel.Year = 2005; newModel.Weight = 3; Console.WriteLine($"{old} compared to the new {newModel}\n\n"); //3) Username Login currentPass = new Login("asdghkl", "1234asdf"); Login previous = new Login(); previous.UserName = "******"; previous.Password = "******"; Console.WriteLine($"{currentPass}\n\n"); Console.WriteLine($"{previous}\n\n"); //4) Contact Info ContactInfo info1 = new ContactInfo("413 Ranchero Pl", "Belton", "Missouri", "64012", "555-555-5555", "*****@*****.**"); ContactInfo bigBird = new ContactInfo(); bigBird.StreetAddress = "123 Sesame Street"; bigBird.City = "New York City"; bigBird.State = "New York"; bigBird.Zip = "12345"; bigBird.Phone = "(123) 456-7890"; bigBird.Email = "*****@*****.**"; Console.WriteLine($"{info1}\n\n{bigBird}"); //Wednesday Homework 5-8 Console.Clear(); //List<ContactInfo> customerContact = new List<ContactInfo> { info1, bigBird };//list for customer info //5)Customer info Customer c1 = new Customer("13357", "Alysha", "Williams", info1); Customer c2 = new Customer(); c2.CustomerId = "1234"; c2.FirstName = "Big"; c2.LastName = "Bird"; c2.CustomerContact = bigBird; Console.WriteLine($"{c1}\n"); Console.WriteLine($"{c2}\n"); //6)Credit Card Account //giving me index errors how to fix them CreditCardAccount cc1 = new CreditCardAccount(768450, c1, 789596.98m, false, 15.3m); CreditCardAccount cc2 = new CreditCardAccount(); cc2.AccountNumber = 02345; cc2.CustomerInfo = c2; cc2.Balance = 1345.2m; cc2.IsPastDue = true; cc2.AnnualInterstRate = 1.3m; Console.WriteLine($"{cc1}\n"); Console.WriteLine($"{cc2}\n"); //7)Book Book newb1 = new Book("How to Write Adventure Modules that Don't Suck", "Goodman Games", 156); Book newb2 = new Book(); newb2.Title = "The Den of Shadows"; newb2.Author = "Amelia Atwater-Rhoades"; newb2.NumberOfPages = 595; Console.WriteLine($"{newb1}\n"); Console.WriteLine($"{newb2}\n"); //8) Library List <Book> books = new List <Book> { newb1, newb2 }; Library library1 = new Library(books, "Peculiar Library", "123 Street", "Peculiar", "Missouri", "64080"); Library library2 = new Library(); library2.Books = books; library2.LibraryName = "Grandview Library"; library2.StreetAddress = "123 Main"; library2.City = "Grandview"; library2.State = "Missouri"; library2.Zip = "64012"; Console.WriteLine($"{library1}\n"); Console.WriteLine($"{library2}\n"); //9)Songs parent of CD Songs ns1 = new Songs("Panic! At the Disco", "Saturday Night", 120); Songs ns2 = new Songs(); ns2.Artist = "Panic! At the Disco"; ns2.Title = "Amen"; ns2.LengthInSeconds = 200; Console.WriteLine(ns1); Console.WriteLine(ns2); Console.Clear(); //10) CD string[] Songs = new string[2]; Songs[0] = Convert.ToString(ns1); Songs[1] = Convert.ToString(ns2); Console.WriteLine(Songs[1]); Console.WriteLine(Songs[0]); CDs ncd1 = new CDs("Panic! At the Disco", "Alternative", Songs);//last spot is printing System.String[] Console.WriteLine(ncd1); CDs ncd2 = new CDs(); ncd2.Artist = "Little Mix"; //ncd2.Title = "Hair"; //ncd2.LengthInSeconds = 380; ncd2.Genre = "Pop"; ncd2.Songs = Songs; Console.WriteLine(ncd2); //11) //11. MotorHome – extend Vehicle //a.numberOfBeds – int MotorHome mh1 = new MotorHome("Ford", "OffRoad", 1999, 3.4f, 1.5f); MotorHome mh2 = new MotorHome(); mh2.Make = "Chevy"; mh2.Model = "Forester"; mh2.Year = 2003; mh2.Weight = 4; mh2.NumberOfBeds = 2.5f; Console.WriteLine(mh1); Console.WriteLine(mh2); //12)Truck ==loadCapacity Trucks nt1 = new Trucks("Jeep", "Jeep", 2015, 2.4f, 2.2f); Trucks nt2 = new Trucks(); nt2.Make = "Toyota"; nt2.Model = "Sienna"; nt2.Year = 2019; nt2.Weight = 3; nt2.LoadCapacity = 4; Console.WriteLine(nt1); Console.WriteLine(nt2); } //end main()
static void Main(string[] args) { //******* Student mumford = new Student("Marcus", "Mumford", "1900", 3.2f); Student ferdinand = new Student(); ferdinand.LastName = "Ferdinand"; ferdinand.FirstName = "Franz"; ferdinand.Gpa = 3.9f; ferdinand.Id = "17"; Console.WriteLine(ferdinand); Console.WriteLine(mumford); //****** Vehicle falcon = new Vehicle("Corellian Corvette", "YT-1300", 5, 30000); Vehicle enterprise = new Vehicle(); enterprise.Make = "Federation Starship"; enterprise.Model = "Galaxy Class"; enterprise.Year = 2300; enterprise.Weight = 1000000; Console.WriteLine(enterprise); Console.WriteLine(falcon); //******* Login myActualLogin = new Login("myName", "12345"); Login secondLogin = new Login(); secondLogin.Username = "******"; secondLogin.Password = "******"; Console.WriteLine(myActualLogin); Console.WriteLine(secondLogin); //******** ContactInfo myInfo = new ContactInfo("3180 Main Street", "Kansas City", "KS", "45825", "913-555-5885", "*****@*****.**"); ContactInfo newAddress = new ContactInfo(); newAddress.StreetAddress = "100 S. Baker Street"; newAddress.City = "London"; newAddress.State = "MO"; newAddress.Zip = "10000"; newAddress.Phone = "816-555-4000"; newAddress.Email = "*****@*****.**"; //Console.WriteLine(myInfo); //Console.WriteLine(newAddress); //******** Customer doorBuster = new Customer("789", "Upton", "Sinclar", myInfo); Customer carlSagan = new Customer(); carlSagan.CustomerId = "790"; carlSagan.FirstName = "Carl"; carlSagan.LastName = "Sagan"; carlSagan.ContactInformation = newAddress; Console.WriteLine("\n"); Console.WriteLine(doorBuster); Console.WriteLine("\n"); Console.WriteLine(carlSagan); //************* CreditCardAccount account1 = new CreditCardAccount(1700, doorBuster, 7256.3m, false, .1m); CreditCardAccount account2 = new CreditCardAccount(); account2.AccountNumber = 1701; account2.AnnualInterestRate = .05m; account2.Balance = 304.12m; account2.CustomerInfo = carlSagan; account2.IsPastDue = false; Console.WriteLine("\n"); Console.WriteLine(account1); Console.WriteLine("\n"); Console.WriteLine(account2); //*********** Book frankenstein = new Book("Frankenstein", "Mary Shelly", 300); Book foreverWar = new Book("The Forever War", "Joe Haldman", 320); Book fourteenNinetyOne = new Book("1491", "Charles C. Mann", 400); Book lotr = new Book(); lotr.Title = "Lord of the Rings"; lotr.Author = "J.R.R. Tolkein"; lotr.NumberOfPages = 1200; Console.WriteLine("\n"); Console.WriteLine(frankenstein); Console.WriteLine("\n"); Console.WriteLine(lotr); //************* List <Book> myBooks = new List <Book>(); myBooks.Add(lotr); myBooks.Add(frankenstein); myBooks.Add(fourteenNinetyOne); myBooks.Add(foreverWar); Library shawneePublicLibrary = new Library(myBooks, "Shawnee Public Library", "400 E. Shawnee Mission Parkway", "Shawnee", "KS", "74147"); Library myPersonalBookshelf = new Library(); myPersonalBookshelf.Books = myBooks; myPersonalBookshelf.City = "Kansas City"; myPersonalBookshelf.LibraryName = "My personal book collection"; myPersonalBookshelf.State = "MO"; myPersonalBookshelf.Zip = "99999"; myPersonalBookshelf.StreetAddress = "700 31st Street"; Console.WriteLine("\n"); Console.WriteLine(shawneePublicLibrary); Console.WriteLine("\n"); Console.WriteLine(myPersonalBookshelf); //***************** Song immigrantSong = new Song("Led Zepplin", "Immigrant Song", 190); Song holdYouNow = new Song(); holdYouNow.Artist = "Vampire Weekend"; holdYouNow.Title = "Hold you now"; holdYouNow.LengthInSeconds = 140; Console.WriteLine("\n"); Console.WriteLine(immigrantSong); Console.WriteLine("\n"); Console.WriteLine(holdYouNow); //***************** Song stairway = new Song("Led Zepplin", "Stairway to heaven", 400); Song jnyb = new Song("Vampire Weekend", "Jerusalem, New York, Berlin", 181); Song[] lz = { immigrantSong, stairway }; Song[] vw = { holdYouNow, jnyb }; Artist ledZeppHits = new Artist(lz, "Led Zepplin Greatest Hits", "Rock"); Artist vampWeekend = new Artist(vw, "Vampire Weekend Presents", "Alt-Rock"); Console.WriteLine("\n"); Console.WriteLine(ledZeppHits); Console.WriteLine(vampWeekend); //************ MotorHome winabango = new MotorHome("Winabango", "S-7", 1989, 4000, 3); MotorHome modifiedBus = new MotorHome(); modifiedBus.Make = "School Bus"; modifiedBus.Model = "modified by owner"; modifiedBus.Year = 2000; modifiedBus.Weight = 8000; modifiedBus.NumberOfBeds = 6; Console.WriteLine("\n"); Console.WriteLine(winabango); Console.WriteLine("\n"); Console.WriteLine(modifiedBus); //************ Truck fjordTough = new Truck("Ford", "F-150", 2003, 1500, 3500f); Truck scottsDadsTruck = new Truck(); scottsDadsTruck.Make = "Chevy"; scottsDadsTruck.Model = "S10"; scottsDadsTruck.Year = 1988; scottsDadsTruck.Weight = 1200; scottsDadsTruck.LoadCapacityLbs = 2000f; Console.WriteLine("\n"); Console.WriteLine(fjordTough); Console.WriteLine("\n"); Console.WriteLine(scottsDadsTruck); }
static void Main(string[] args) { Console.WriteLine("====== Testing for Classes Library ======\n\n"); Student s1 = new Student(); s1.FirstName = "Tony"; s1.LastName = "Stark"; s1.Id = "54321"; s1.GPA = 4.0F; Student s2 = new Student(); s2.FirstName = "Steve"; s2.LastName = "Rogers"; s2.Id = "12345"; s2.GPA = 3.95F; Console.WriteLine(s1); Console.WriteLine(s2); Vehicle v1 = new Vehicle(); v1.Make = "Honda"; v1.Model = "Civic"; v1.Year = 2012; v1.Weight = 25450f; Console.WriteLine(v1); Login l1 = new Login(); l1.Username = "******"; l1.Password = "******"; Console.WriteLine(l1); ContactInfo c1 = new ContactInfo(); c1.StreetAddress = "1400 Veterans United Drive"; c1.City = "Columbia"; c1.State = "MO"; c1.Zip = "65203"; c1.Phone = "800-814-1103"; c1.Email = "*****@*****.**"; Console.WriteLine(c1); Customer cu1 = new Customer(); cu1.CustomerId = "1234"; cu1.FirstName = "Ron"; cu1.LastName = "Swanson"; cu1.ContactInformation = c1; Console.WriteLine(cu1); CreditCardAccount cc1 = new CreditCardAccount(); cc1.AccountNumber = 1234; cc1.CustomerInfo = cu1; cc1.Balance = 125.56m; cc1.IsPastDue = false; cc1.AnnualInterestRate = 0.05m; Console.WriteLine(cc1); Book bk1 = new Book(); bk1.Title = "Where the Red Fern Grows"; bk1.Author = "Blue"; bk1.NbrOfPages = 325; Book bk2 = new Book("How to Get People to Like You", "Ryan Burton", 450); Console.WriteLine(bk1); Console.WriteLine(bk2); Library lb1 = new Library(); lb1.Books = new List <Book>() { bk1, bk2 }; lb1.LibraryName = "Columbia Public Library"; lb1.StreetAddress = "1400 Broadway"; lb1.City = "Columbia"; lb1.State = "MO"; lb1.Zip = "65203"; Console.WriteLine(lb1); Song sg1 = new Song("Mariah Carey", "Always Be My Baby", 150); Song sg2 = new Song("Mariah Carey", "Daydream", 150); Song sg3 = new Song("Mariah Carey", "When I Saw You", 150); Console.WriteLine(sg1); Song[] cd1tracks = { sg1, sg2, sg3 }; CD cd1 = new CD(cd1tracks, "Daydream", "Pop"); Console.WriteLine(cd1); MotorHome m1 = new MotorHome("Winnie", "RR", 1995, 2000, 4); Console.WriteLine(m1); Truck t1 = new Truck("Ford", "F150", 2005, 35000, 225.50f); Console.WriteLine(t1); }
static void Main(string[] args) { //Student s1 = new Student(); //s1.FirstName = "Johnny"; //s1.LastName = "Johnson"; //s1.Id = "543321"; //s1.Gpa = 3.3f;//couldnt enter in decimal places, why is that? //Console.WriteLine(s1); //Student s2 = new Student("Davie", "Davison", "12345", 4); //Console.WriteLine(s2); //Vehicle v1 = new Vehicle("Ford", "Fiesta", 1996, 2045); //Console.WriteLine(v1); //Vehicle v2 = new Vehicle(); //v2.Make = "Dodge"; //v2.Model = "Intrepid"; //v2.Year = 1998; //v2.Weight = 2929; //Console.WriteLine(v2); //Login L1 = new Login(); //L1.UserName = "******"; //L1.Password = "******"; //Console.WriteLine(L1); //Login L2 = new Login("Harry", "Harry's password"); //Console.WriteLine(L2); //ContactInfo c1 = new ContactInfo("1234 Mayflower Dr.", "Denver", "CO", "64601", "6460211", "*****@*****.**"); //Console.WriteLine(c1); //ContactInfo c2 = new ContactInfo(); //c2.StreetAddress = "2435 Rocky Rd."; //c2.City = "Belmont"; //c2.State = "Me"; //c2.Zip = "75758"; //c2.Phone = "7578484"; //c2.Email = "*****@*****.**"; //Console.WriteLine(c2); //Customer cust1 = new Customer("73838", "Barry", "Bouncealot", new ContactInfo("1244","Burg","MO","67859","6868888","*****@*****.**")); //Console.WriteLine("\n"+ cust1); //Customer cust2 = new Customer(); //cust2.CustomerId = "1234"; //cust2.FirstName = "Susie"; //cust2.LastName = "Barrington"; //cust2.ContactInformation = new ContactInfo("12 Launch Ln", "chilli", "mo", "64692", "7478383", "*****@*****.**"); //Console.WriteLine("\n"+cust2); //CreditCardAccount CCA1 = new CreditCardAccount(1234, new Customer("1234", "Bob", "Smith", new ContactInfo("12 St.", "hapsburg", "MO", "64601", "6460111", "*****@*****.**")), 239.32m, true, 22.5m); //Console.WriteLine("\n"+CCA1); //CreditCardAccount CCA2 = new CreditCardAccount(); //CCA2.AccountNumber =74747; //CCA2.CustomerInfo = new Customer("1324", "Jonnhy", "Samuels", new ContactInfo("12 Rd", "KC", "MO", "64052", "646474", "*****@*****.**")); //CCA2.Balance = 294.30m; //CCA2.IsPastDue = false; //CCA2.AnnualInterestRate = 4.4m; //Console.WriteLine("\n"+CCA2); //Book bk1 = new Book("How to win", "Dale Carnegie", 542); //Console.WriteLine("\n" + bk1); //Book bk2 = new Book(); //bk2.Title = "7Habits"; //bk2.Author = "Stephen Colvey"; //bk2.NumberOfPages = 784; //Console.WriteLine("\n"+bk2); //List<Book> books = new List<Book>() { bk1, bk2 }; //Library lb1 = new Library(books,"Livingston", "123 Clay", "chiill","MO","74740"); //Console.WriteLine("\n"+ lb1); //Library lb2 =new Library(); //lb2.Books = books; //lb2.LibraryName = "grundy"; //lb2.StreetAddress = "422 Mud"; //lb2.City = "trenton"; //lb2.State = "MO"; //lb2.Zip = "84848"; //Console.WriteLine("\n"+lb2); Song s1 = new Song("McFly", "Missin U", 5555); Console.WriteLine(s1); Song s2 = new Song(); s2.Artist = "Rickfly"; s2.Title = "Dissin u"; s2.LengthInSeconds = 4444; Console.WriteLine(s2 + "\n"); List <Song> tracks = new List <Song>() { s1, s2 }; Artist cd1 = new Artist(tracks, "CSF2", "Hard-Core Rap"); Console.WriteLine(cd1 + "\n"); Artist cd2 = new Artist(); cd2.Tracks = tracks; cd2.Title = "csf2"; cd2.Genre = "SOFTWARE WRAP"; Console.WriteLine(cd2 + "\n"); MotorHome sportsMobile = new MotorHome("Mercedes", "Sprinter", 2020, 5000, 6); Console.WriteLine(sportsMobile + "\n"); MotorHome pleasureWay = new MotorHome(); pleasureWay.Make = "Zimbabwe"; pleasureWay.Model = "Zaire"; pleasureWay.Year = 9999; pleasureWay.Weight = 0; pleasureWay.NumberOfBeds = 899; Console.WriteLine(pleasureWay + "\n"); Truck tundra = new Truck("Toyota", "Tundra", 2020, 5000, 5000); Console.WriteLine(tundra); Truck chevy = new Truck(); chevy.Make = "Chevy"; chevy.Model = "Silverado"; chevy.Year = 2020; chevy.Weight = 5000; chevy.LoadCapacityLbs = 5000; Console.WriteLine(chevy); }