public Form1() { InitializeComponent(); _context = SynchronizationContext.Current; string entropy = "?|2^&(*$:@!!*"; _oldUrl = OptionApi.GetString("SendLinkServiceUrl");//, _oldUrl); _oldDeviceToken = OptionApi.GetEncrypted("SendLinkDeviceToken", entropy); _oldLogin = OptionApi.GetString("SendLinkCloudStorageLoginName"); //, _oldLogin); _server = new Server(Constants.Port); _server.OnPost("/sign_ups.xml").Respond(OnRespond); _server.OnPost("/user_sessions.xml").Respond(OnRespond); _server.OnGet("/current_user.xml").Respond(OnRespond); _server.OnPost("/folders.xml").Respond(OnRespond); _server.OnPost(string.Format("/folders/{0}/members.xml", Constants.FolderId)).Respond(OnRespond); _server.OnPut(string.Format("/folders/{0}/permission.xml", Constants.FolderId)).Respond(OnRespond); _server.OnPut(string.Format("/folders/{0}.xml", Constants.FolderId)).Respond(OnRespond); _server.OnPost("/file_versions.xml").Respond(OnRespond); _server.OnPost("/aws").Respond(OnRespond); _server.OnPut(string.Format("/file_versions/{0}.xml", Constants.FileId)).Respond(OnRespond); _server.OnGet(string.Format("/files/{0}.xml", Constants.AnotherFileId)).Respond(OnRespond); _server.OnPost("/validations/current_user/resend.xml").Respond(OnRespond); }
public UnitTestSkyDoxServer(int port) { _server = new Server(port); _server.OnPost("/sign_ups.xml").Respond(OnPostSignUps); _server.OnPost("/user_sessions.xml").Respond(OnPostUserSessions); _server.OnGet("/current_user.xml").Respond(OnGetCurrentUser); _server.OnPost("/folders.xml").Respond(OnPostFolders); _server.OnPost(string.Format("/folders/{0}/members.xml", _folderId)).Respond(OnPostMembers); _server.OnPut(string.Format("/folders/{0}/permission.xml", _folderId)).Respond(OnPutPermissions); _server.OnPut(string.Format("/folders/{0}.xml", _folderId)).Respond(OnPutFolder); _server.OnPost("/validations/resend.xml").Respond(OnValidations); NextResponse = new Queue<MockResponse>(); Requests = new List<RequestPair>(); }
public MockServer(int port) { _server = new Server(port); _server.OnPost("/sign_ups.xml").Respond(OnRespond); _server.OnPost("/user_sessions.xml").Respond(OnRespond); _server.OnGet("/current_user.xml").Respond(OnRespond); _server.OnPost("/folders.xml").Respond(OnRespond); _server.OnPost(string.Format("/folders/{0}/members.xml", Constants.FolderId)).Respond(OnRespond); _server.OnPut(string.Format("/folders/{0}/permission.xml", Constants.FolderId)).Respond(OnRespond); _server.OnPut(string.Format("/folders/{0}.xml", Constants.FolderId)).Respond(OnRespond); _server.OnPost("/file_versions.xml").Respond(OnRespond); _server.OnPost("/aws").Respond(OnRespond); _server.OnPut(string.Format("/file_versions/{0}.xml", Constants.FileId)).Respond(OnRespond); _server.OnGet(string.Format("/files/{0}.xml", Constants.AnotherFileId)).Respond(OnRespond); _server.OnPost("/validations/current_user/resend.xml").Respond(OnRespond); }