public static void StartApiServer(this SpecContext context)
        {
            var server = context.Get <ApiServer>();

            if (server == null)
            {
                context.Set(new ApiServer());
            }

            context.Get <ApiServer>().Start();
        }
예제 #2
0
        private static void ShouldSeeTheBudgetForCurrentMonth(SpecContext context)
        {
            var startOfMonth = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
            var endOfMonth   = new DateTime(startOfMonth.Year, startOfMonth.Month, DateTime.DaysInMonth(startOfMonth.Year, startOfMonth.Month));

            var budget = context.Get <BudgetModel>();

            Assert.AreEqual(startOfMonth, budget.StartDate);
            Assert.AreEqual(endOfMonth, budget.EndDate);
        }
예제 #3
0
        private static void ShouldSeeNoBudgetedItems(SpecContext context)
        {
            var budget = context.Get <BudgetModel>();

            Assert.AreEqual(0, budget.Categories.SelectMany(c => c.Items).Count());
        }
예제 #4
0
        private static void ShouldSeeNoBudgetCategories(SpecContext context)
        {
            var budget = context.Get <BudgetModel>();

            Assert.AreEqual(0, budget.Categories.Length);
        }