public AuthenticationController()
        {
            _db = new EF_Login_Data_Repository();

            _service_manager_save_file = Path.Combine(HostingEnvironment.ApplicationPhysicalPath, "App_Data", "temp_Service_Manager.data");
            _service_manager = load_Service_Manger();
        }
コード例 #2
0
 public void Service_Manager_object_should_still_hold_attempts_when_deserialized()
 {
     string filename = "temp_Service_Manager.data";
     Service_Manager service = new Service_Manager();
     string ip= "my ip";
     service.record_failed_attempt(ip);
     object objectToSerialize = service;
     ObjectSerializing.SerializeObject(filename, objectToSerialize);
     Service_Manager retrieved_service = (Service_Manager)ObjectSerializing.DeSerializeObject(filename);
     Assert.IsNotNull(retrieved_service);
     Assert.IsNotNull(retrieved_service.Attempts[0]);
 }
 public AuthenticationController(IDataRepository db)
 {
     _db = db;
     _service_manager = new Service_Manager(); // lock is not persistant for testing
 }
 public Service_ManagerController()
 {
     _service_manager_save_file = Path.Combine(HostingEnvironment.ApplicationPhysicalPath, "App_Data", "temp_Service_Manager.data");
     _service_manager = load_Service_Manger();
 }