Exemplo n.º 1
0
        public void Test3_Ex2_SomeFeatureTest()
        {
            SomeFeature target;

            target = new SomeFeature();
            Assert.NotNull(target);
        }
Exemplo n.º 2
0
        public static void TestSemicolonStripping()
        {
            SomeFeature feature = new SomeFeature();

            feature?.DoSomething("test");

            Assert.AreEqual("test", feature.type, "Template ending with semicolon has its semicolon stripped at build time.");
        }
Exemplo n.º 3
0
        public void When_Feature_Is_Used__Should_Call_OnUse_On_Feature()
        {
            var feature = new SomeFeature();

            this.Register(feature);

            this.Use <SomeFeature>();

            feature.OnUseCalled.Should().BeTrue();
        }
        public async Task <IActionResult> Edit(SomeFeature someFeature)
        {
            if (!ModelState.IsValid)
            {
                return(View(someFeature));
            }
            var someFeatureDb = await _context.SomeFeatures.FindAsync(someFeature.Id);

            someFeatureDb.Title     = someFeature.Title;
            someFeatureDb.Paragraph = someFeature.Paragraph;
            someFeatureDb.Icon      = someFeature.Icon;

            await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            SomeFeature someFeature = await _context.SomeFeatures.FindAsync(id);

            if (someFeature == null)
            {
                return(NotFound());
            }

            return(View(someFeature));
        }