public void Calculate_DoubleCoffe_ReturnCoffeCount()
        {
            var service = new MorningService();
            var array   = new string[] { "1", "3", "2", "3" };

            var output = service.CalculateOrder(array);

            Assert.Equal("eggs, toast, coffee(x2)", output);
        }
        public void Calculate_DuplicatedValues_ReturnDistinct()
        {
            var service = new MorningService();
            var array   = new string[] { "1", "1", "2", "3" };

            var output = service.CalculateOrder(array);

            Assert.Equal("eggs, toast, coffee", output);
        }
Ejemplo n.º 3
0
        public IDayTimeService BuildAndGetInstance()
        {
            IDayTimeService nightService     = new NightService();
            IDayTimeService duskService      = new DuskService(nightService);
            IDayTimeService afternoonService = new AfternoonService(duskService);
            IDayTimeService noonService      = new NoonService(afternoonService);
            IDayTimeService morningService   = new MorningService(noonService);
            IDayTimeService dawnService      = new DawnService(morningService);

            return(dawnService);
        }
Ejemplo n.º 4
0
        public MorningServiceTest()
        {
            _morningRepository = new Mock <IMorningRepository>();

            _morningRepository.Setup(x => x.GetAll()).ReturnsAsync(new List <Morning>()
            {
                new Morning(DishType.Entree, "Eggs"),
                new Morning(DishType.Side, "Toast"),
                new Morning(DishType.Drink, "Coffee"),
                new Morning(DishType.Dessert, "Error"),
                new Morning(DishType.Error, "Error")
            });

            _morningService = new MorningService(_morningRepository.Object);
        }