public IActionResult Update(Category category) { FakeDataHelper.SetCategory(category); var newCategory = FakeDataHelper.GetCategory(category.UID); return(View(viewPath + "Edit", newCategory)); }
public IActionResult Update(Material material) { FakeDataHelper.SetMaterial(material); var newMaterial = FakeDataHelper.GetMaterial(material.UID); return(View(viewPath + "Edit", newMaterial)); }
public IActionResult Index() { var categoryUids = materials.Select(m => m.CategoryUid).Distinct().ToList(); Dictionary <Guid, string> categoryMap = FakeDataHelper.GetCategoryMap(categoryUids); return(View(index, (materials, categoryMap))); }
public IActionResult Activate(Guid uid) { var category = FakeDataHelper.GetCategory(uid); category.Activation = true; FakeDataHelper.SetCategory(category); return(RedirectToAction("Index")); }
public void Test() { var testResultMessage = FakeDataHelper.GetPassed_Failed_Ignored_Message(); var parser = new TestDetailParser(); var list = parser.CreateTestDetails(testResultMessage); Assert.Pass(); }
/// <summary> /// Fills the organizations, products and activity objects with data for the specified configuration /// </summary> /// <param name="conf"></param> public void GenerateFakeData(int numberOfFakeEntities) { var watch = System.Diagnostics.Stopwatch.StartNew(); organizations = FakeDataHelper.GenerateOrganizations(numberOfFakeEntities); products = FakeDataHelper.GenerateProducts(numberOfFakeEntities); activities = FakeDataHelper.GenerateActivities(numberOfFakeEntities); locations = FakeDataHelper.GenerateLocations(numberOfFakeEntities); watch.Stop(); Console.WriteLine("Took " + watch.ElapsedMilliseconds + "ms to generate " + products.Count + " products of" + " fake data to insert into database"); }
public HttpStatusCode SetLayouts([FromQuery] string location, [FromBody] List <Core.Layout> layouts) { try { FakeDataHelper.SetLayouts(location, layouts); return(HttpStatusCode.OK); } catch (Exception ex) { // 記得寫LOG return(HttpStatusCode.InternalServerError); } }
public void Should_Get_Test_Result_For_Failed_Ignored_Message() { var testResultMessage = FakeDataHelper.GetFailed_Ignored_Message(); var messageParser = new MessageParser(new TestSummaryParser(), new TestDetailParser()); var testResult = messageParser.GetTestResult(testResultMessage); var expectedResult = new TestSummary { TotalNumberOfTests = 2, ProjectName = "TestProjectUsedByAutoTestRunner.dll", NumberOfFailedTests = 1, NumberOfIgnoredTests = 1, NumberOfPassedTests = null, TimeTakenInSecond = 1.7281m }; testResult.Should().BeEquivalentTo(expectedResult); }
public static void Initialise(IServiceProvider serviceProvider) { using (var context = new NoteTakerContext(serviceProvider.GetRequiredService <DbContextOptions <NoteTakerContext> >(), serviceProvider.GetRequiredService <IHttpContextAccessor>())) { if (context.Users.Any()) { return; } if (!context.Notes.Any()) { // password is apples var user = new User("CallumBreen", "Callum", "Breen", "$2b$10$m59R6F0ubBmQKMxksCizJ.zdToQ5wCLdwTM3S1HA5GyqjwhmC5fri"); context.Users.Add(user); var notes = FakeDataHelper.GetNotes(user, 200).ToList(); context.Notes.AddRange(notes); context.SaveChanges(); } } }
public IActionResult Add(Material material) { FakeDataHelper.SetMaterial(material); return(RedirectToAction("Index")); }
public IActionResult Add(Category category) { FakeDataHelper.SetCategory(category); return(RedirectToAction("Index")); }
public RedirectToRouteResult CreateFakeEnterprise(bool modified) { FakeDataHelper.CreateFakeEnterprise(Db, modified); return(RedirectToAction("Index")); }
public List <Core.Layout> GetLayouts(string location) { return(FakeDataHelper.GetLayouts(location)); }