Example #1
0
        public void GetTotalFuel_ReturnsFuelWeight_Int()
        {
            //Arrange
            var weight = new FuelWeight(1000, 1400, "Los Angeles");

            //Act
            weight.CalcWeight();

            //Assert
            Assert.AreEqual(595, weight.Fuel);
        }
Example #2
0
        public void GetTotalFuel_ReturnsFuelWeight2_Int()
        {
            //Arrange
            var weight = new FuelWeight(2000, 9400, "International Space Station");

            //Act
            weight.CalcWeight();

            //Assert
            Assert.AreEqual(43886, weight.Fuel);
        }
        public void GetTotalFuel_ReturnsFuelWeight2_Int()
        {
            //Arrange
            var weight = new FuelWeight(2000, 9400);

            //Act
            var result    = Math.Round((double)weight.CalcWeight());
            int intResult = (int)result;

            //Assert
            Assert.AreEqual(43886, intResult);
        }
Example #4
0
        public IActionResult Results()
        {
            int        rocketWeight = Int32.Parse(Request.Form["Weight"]);
            FuelWeight LA           = new FuelWeight(rocketWeight, 1400, "Los Angeles");

            LA.CalcWeight();
            FuelWeight station = new FuelWeight(rocketWeight, 9400, "International Space Station");

            station.CalcWeight();
            FuelWeight moon = new FuelWeight(rocketWeight, 17500, "The Moon");

            moon.CalcWeight();
            FuelWeight mars = new FuelWeight(rocketWeight, 21100, "Mars");

            mars.CalcWeight();



            List <FuelWeight> model = new List <FuelWeight> {
                LA, station, moon, mars
            };

            return(View("Index", model));
        }