private GetQualityCheckRulesAndFileSheets ( int fileId ) : Task |
||
fileId | int | |
리턴 | Task |
public async Task GetQualityCheckRulesAndFileSheets_ShouldReturnHttpStatusCodeOK_WhenFileServiceReturnsAXlsxFile() { IFileService fileService = new StubIFileService() { GetFileByFileIdInt32 = (fileId) => new File() { Name = "abc.xlsx" }, GetDocumentSheetDetailsFile = (file) => Task.FromResult<IEnumerable<FileSheet>>(null) }; IFileServiceFactory fileServiceFactory = new StubIFileServiceFactory() { GetFileServiceString = instanceName => fileService }; IQCService qcService = new StubIQCService(); using (ShimsContext.Create()) { ShimIdentityHelper.GetCurrentUserIUserServiceClaimsPrincipal = (service, principle) => new User(); QCController fileController = new QCController(qcService, fileServiceFactory, null); fileController.Request = new HttpRequestMessage(HttpMethod.Get, string.Empty); fileController.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = new HttpConfiguration(); HttpResponseMessage httpResponseMessage = await fileController.GetQualityCheckRulesAndFileSheets(0); Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode); } }
public async Task GetQualityCheckRulesAndFileSheets_ShouldReturnHttpStatusCodeNotImplemented_WhenFileServiceReturnsAFileOtherThanXlsxAndCsv() { IFileService fileService = new StubIFileService() { GetFileByFileIdInt32 = (fileId) => new File() { Name = "abc.xyz" } }; IFileServiceFactory fileServiceFactory = new StubIFileServiceFactory() { GetFileServiceString = instanceName => fileService }; using (ShimsContext.Create()) { ShimIdentityHelper.GetCurrentUserIUserServiceClaimsPrincipal = (service, principle) => new User(); QCController fileController = new QCController(null, fileServiceFactory, null); fileController.Request = new HttpRequestMessage(HttpMethod.Get, string.Empty); fileController.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = new HttpConfiguration(); HttpResponseMessage httpResponseMessage = await fileController.GetQualityCheckRulesAndFileSheets(0); Assert.AreEqual(HttpStatusCode.NotImplemented, httpResponseMessage.StatusCode); } }