public void CreateConfig() { FileStream stream = File.Create(ExistingFile); stream.Close(); _validDataStore = new DataStore { Path = ExistingFile }; Directory.CreateDirectory(("Content")); }
public void RemoveFile() { var dataStore = new DataStore(); dataStore.CreateDataStore(DataStoreFileName); Assert.IsTrue(File.Exists(DataStoreFileName)); dataStore.RemoveDataStore(); Assert.IsFalse(File.Exists(DataStoreFileName)); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); var dataStore = new DataStore(); dataStore.CreateDataStore(HostingEnvironment.ApplicationPhysicalPath + Properties.Settings.Default["store"].ToString()); }
public static List<EmployeeModel> FindByEmploymentStatusFilter(EmploymentStatusFilter? filterList, string path) { var dataStore = new DataStore { Path = path }; var employeeModels = dataStore.GetAllRecords(); if (filterList.HasValue && filterList != EmploymentStatusFilter.All) { var removeStatus = (filterList.Value == EmploymentStatusFilter.No); employeeModels.RemoveAll(employee => employee.IsCurrentEmployee == removeStatus); } return employeeModels; }
public void CreateEmployee() { _identifier = Guid.Parse("21d9fb81-bdf8-4c4e-b397-01018f30e90b"); _currentEmployeeModel = new EmployeeModel { Id = _identifier, Age = 5, FirstName = "john", LastName = "smith", IsCurrentEmployee = true }; var secondEmployeeId = Guid.Parse("31d9fb81-bdf8-4c4e-b397-01018f30e90b"); _secondEmployeeModel = new EmployeeModel { Id = secondEmployeeId, Age = 1, FirstName = "pete", LastName = "John", Gender = EmployeeGender.Male, IsCurrentEmployee = false }; _dataStore = new DataStore(); _dataStore.CreateDataStore("test.data"); _employeeController = new EmployeeController(_path); }
public void InvalidRecordCalled() { var dataStore = new DataStore(); dataStore.CreateDataStore(DataStoreFileName); dataStore.GetRecordById(Guid.NewGuid()); }
public void InvalidPath() { var invalidDataStore = new DataStore { Path = "failure to communicate" }; }
public void CreateFile() { var config = new DataStore(); config.CreateDataStore(DataStorePath + DataStoreFileName); Assert.IsTrue(File.Exists(DataStorePath + DataStoreFileName)); }
public static EmployeeModel LoadById(Guid id, string path) { var dataStore = new DataStore { Path = path }; return dataStore.GetRecordById(id); }
public static void DeleteById(Guid id, string path) { var dataStore = new DataStore { Path = path }; dataStore.RemoveRecordById(id); }
public void Save(string path) { var dataStore = new DataStore { Path = path }; dataStore.SaveRecord(this); }