Exemple #1
0
        public async void InverseGovermentApprovalFromTrueToFalse_FromInitializedDbTable_GovermentApprovalFalse()
        {
            // arrange
            var recipe = GetRecipe();

            fixture.db.Add(recipe);
            await fixture.db.SaveChangesAsync();

            // act
            await logic.InverseGovermentApprovalAsync(recipe.Id);

            // assert
            var actual = await fixture.db.Recipe.FirstOrDefaultAsync(i => i.Id == recipe.Id);

            Assert.False(actual.GovermentApproval);
        }
Exemple #2
0
        public async Task <IActionResult> InverseGovermentApproval(string key)
        {
            int recipeId = Int32.Parse(key);
            await logic.InverseGovermentApprovalAsync(recipeId);

            await logProvider.AddToLogAsync($"Recipe (Id: {recipeId}) changed goverment approval state.");

            return(RedirectToRoute(RecipesRouting.SingleItem, new { key = key }));
        }