Esempio n. 1
0
        public void BookCalculatesAnAverage()
        {
            //arrange
            BookInMemory book = new BookInMemory("");

            book.AddGrade(89.1);
            book.AddGrade(90.5);
            book.AddGrade(77.3);


            /*int x = 5;
             * int y =10;
             * int expect = 15;*/

            //act

            Statistics result = book.GetStatistic();

            //int actual = 5+10;


            //assert

            book.GetStatistic();
            Assert.Equal(85.6, result.average, 1);
            Assert.Equal(90.5, result.highGrade);
            Assert.Equal(77.3, result.lowGrade);
            Assert.Equal('B', result.letter);

            //Assert.Equal(expect,actual);
        }
Esempio n. 2
0
        public void BookCaclulatesStats()
        {
            //arrange - variable declaration
            var book = new BookInMemory("");

            book.AddGrade(89.1);
            book.AddGrade(90.5);
            book.AddGrade(77.3);

            //act - method call for outputs
            var result = book.GetStatistics();

            //assert - test
            Assert.Equal(85.6, result.Average, 1);
            Assert.Equal(90.5, result.High, 1);
            Assert.Equal(77.3, result.Low, 1);
            Assert.Equal('B', result.Letter);
        }
Esempio n. 3
0
 void SetName(BookInMemory obj1, string name)
 {
     obj1.nameBook = name;
 }
Esempio n. 4
0
 void GetBookSetName(BookInMemory obj, string name)
 {
     //crea un objeto llamado obj en este metodo pero no es el mismo que el obj1 de arriba
     obj = new BookInMemory(name);
 }