示例#1
0
 static void Main(string[] args)
 {
     Book book1=new Book();
     Book book2=new Book();
     Console.WriteLine("Enter first Book Price:");
     book1.Price = float.Parse(Console.ReadLine());
     Console.WriteLine("Enter second Book Price:");
     book2.Price = float.Parse(Console.ReadLine());
     Console.WriteLine(book1.BookCompare(book2));
     Console.ReadKey();
 }
示例#2
0
        static void Main(string[] args)
        {
            Book Kirja = new Book();
            Kirja.PageCount = 200;
            Kirja.Name = "Mars";
            Kirja.Author = "Ben Bova";
            Kirja.Genre = "Sci-Fi";

            Kirja.PrintData();
            Kirja.DecreaseCount();
            Kirja.NameChange();
            Kirja.PrintData();

        }
示例#3
0
        public void TestMethod1()
        {
            Book book = new Book();
            book.KnowPagesLeft(5000);
            Assert.IsTrue(Book.DayNorm < 0);

            //try
            //{
            //    Book book = new Book();
            //    book.KnowPagesLeft(5000);
            //    Assert.IsTrue(Book.DayNorm > 0);
            //}
            //catch (AssertionException ex)
            //{
            //    Console.WriteLine("DayNorm can't be less than zero");
            //    Console.WriteLine(ex.Message);
            //}
            //catch (Exception ex)
            //{

            //    Console.WriteLine(ex.Message);
            //}
        }
 public static void MyTest()
 {
     Book book = new Book();
     book.KnowPagesLeft(5000);
     Assert.IsTrue(Book.DayNorm < 0);
 }