public static void StartApiServer(this SpecContext context) { var server = context.Get <ApiServer>(); if (server == null) { context.Set(new ApiServer()); } context.Get <ApiServer>().Start(); }
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); }
private static void ShouldSeeNoBudgetedItems(SpecContext context) { var budget = context.Get <BudgetModel>(); Assert.AreEqual(0, budget.Categories.SelectMany(c => c.Items).Count()); }
private static void ShouldSeeNoBudgetCategories(SpecContext context) { var budget = context.Get <BudgetModel>(); Assert.AreEqual(0, budget.Categories.Length); }