fix tests

This commit is contained in:
Фролов 2022-01-06 11:03:11 +05:00
parent 345ca47f87
commit e9d980438b
2 changed files with 6 additions and 12 deletions

View File

@ -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);

View File

@ -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("_");
}
}