forked from ddrilling/AsbCloudServer
fix tests
This commit is contained in:
parent
345ca47f87
commit
e9d980438b
@ -8,6 +8,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Claims;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
namespace AsbCloudWebApi.Tests.ControllersTests
|
||||
@ -38,6 +39,9 @@ namespace AsbCloudWebApi.Tests.ControllersTests
|
||||
wellService.Setup(s => s.IsCompanyInvolvedInWell(It.IsAny<int>(), It.IsAny<int>()))
|
||||
.Returns(true);
|
||||
|
||||
wellService.Setup(s => s.IsCompanyInvolvedInWellAsync(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<CancellationToken>()))
|
||||
.Returns(Task.FromResult(true));
|
||||
|
||||
controller = new TelemetryAnalyticsController(analyticsService.Object,
|
||||
wellService.Object);
|
||||
|
||||
@ -149,8 +153,8 @@ namespace AsbCloudWebApi.Tests.ControllersTests
|
||||
{
|
||||
var emptyAnalyticsService = new Mock<ITelemetryAnalyticsService>();
|
||||
|
||||
emptyAnalyticsService.Setup(s => s.GetWellDepthToDayAsync(It.IsAny<int>(), CancellationToken.None).Result)
|
||||
.Returns(value: null);
|
||||
emptyAnalyticsService.Setup(s => s.GetWellDepthToDayAsync(It.IsAny<int>(), CancellationToken.None))
|
||||
.Returns(Task.FromResult<IEnumerable<WellDepthToDayDto>>(null));
|
||||
|
||||
var newControllerInstance = new TelemetryAnalyticsController(emptyAnalyticsService.Object,
|
||||
wellService.Object);
|
||||
|
@ -21,16 +21,6 @@ namespace ConsoleApp1
|
||||
{
|
||||
using var db = new AsbCloudDbContext(options);
|
||||
|
||||
var wellOperationImportService = new WellOperationImportService(db);
|
||||
|
||||
//var inStream = System.IO.File.OpenRead(@"C:\temp\Миграция.xlsx");
|
||||
//wellOperationImportService.Import(1, inStream);
|
||||
var stream = wellOperationImportService.Export(1);
|
||||
var fs = System.IO.File.Create(@"C:\temp\2.xlsx");
|
||||
stream.CopyTo(fs);
|
||||
fs.Flush();
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Console.WriteLine("_");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user