This repository has been archived by the owner on Feb 19, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #553 from amay077/feature/issue-539
[Android/iOS]アプリの通信処理の Mock 化
- Loading branch information
Showing
12 changed files
with
184 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using Covid19Radar.Model; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Net; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Xamarin.Forms; | ||
|
||
namespace Covid19Radar.Services | ||
{ | ||
class HttpDataServiceMock : IHttpDataService | ||
{ | ||
Task<Stream> IHttpDataService.GetTemporaryExposureKey(string url, CancellationToken cancellationToken) | ||
{ | ||
return Task.Factory.StartNew<Stream>(() => { | ||
Debug.WriteLine("HttpDataServiceMock::GetTemporaryExposureKey called"); | ||
return new MemoryStream(); | ||
}); | ||
} | ||
|
||
Task<List<TemporaryExposureKeyExportFileModel>> IHttpDataService.GetTemporaryExposureKeyList(string region, CancellationToken cancellationToken) | ||
{ | ||
return Task.Factory.StartNew<List<TemporaryExposureKeyExportFileModel>>(() => { | ||
Debug.WriteLine("HttpDataServiceMock::GetTemporaryExposureKeyList called"); | ||
return new List<TemporaryExposureKeyExportFileModel>(); | ||
}); | ||
} | ||
|
||
async Task<UserDataModel> IHttpDataService.PostRegisterUserAsync() | ||
{ | ||
Debug.WriteLine("HttpDataServiceMock::PostRegisterUserAsync called"); | ||
|
||
UserDataModel userData = new UserDataModel(); | ||
userData.Secret = "dummy secret"; | ||
userData.UserUuid = "dummy uuid"; | ||
userData.JumpConsistentSeed = 999; | ||
userData.IsOptined = true; | ||
Application.Current.Properties["Secret"] = userData.Secret; | ||
await Application.Current.SavePropertiesAsync(); | ||
return userData; | ||
} | ||
|
||
Task<HttpStatusCode> IHttpDataService.PutSelfExposureKeysAsync(DiagnosisSubmissionParameter request) | ||
{ | ||
return Task.Factory.StartNew<HttpStatusCode>(() => | ||
{ | ||
Debug.WriteLine("HttpDataServiceMock::PutSelfExposureKeysAsync called"); | ||
return HttpStatusCode.OK; | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Covid19Radar.Model; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Net; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Covid19Radar.Services | ||
{ | ||
public interface IHttpDataService | ||
{ | ||
Task<UserDataModel> PostRegisterUserAsync(); | ||
|
||
Task<HttpStatusCode> PutSelfExposureKeysAsync(DiagnosisSubmissionParameter request); | ||
|
||
Task<List<TemporaryExposureKeyExportFileModel>> GetTemporaryExposureKeyList(string region, CancellationToken cancellationToken); | ||
|
||
Task<Stream> GetTemporaryExposureKey(string url, CancellationToken cancellationToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters