Фиксы

1. Удалён лишний тест. В данном тесте никогда не возникнет BadRequest. Если идентификатор скважины не валиден у нас возникнет Forbidden.
2. Сделал коллекцию прав потокобезопасной, чтобы не возникало состояние RaiseCondition
This commit is contained in:
Степанов Дмитрий 2024-03-13 14:49:28 +03:00
parent 8f29a9178b
commit 0b9fd49039
2 changed files with 3 additions and 18 deletions

View File

@ -151,20 +151,6 @@ public class ProcessMapPlanDrillingControllerTest: BaseIntegrationTest
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
} }
[Fact]
public async Task InsertRange_returns_BadRequest_for_IdWell()
{
//arrange
var badDto = dto.Adapt<ProcessMapPlanDrillingDto>();
badDto.IdWell = int.MaxValue;
//act
var response = await client.InsertRange(dto.IdWell, new[] { badDto });
//assert
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
}
[Fact] [Fact]
public async Task ClearAndInsertRange_returns_success() public async Task ClearAndInsertRange_returns_success()
{ {

View File

@ -1,13 +1,12 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
namespace AsbCloudWebApi namespace AsbCloudWebApi
{ {
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class PermissionAttribute : Attribute public class PermissionAttribute : Attribute
{ {
public static SortedSet<string> Registered { get; } = new SortedSet<string>(); public static ConcurrentBag<string> Registered { get; } = new();
public string Name { get; set; } = null!; public string Name { get; set; } = null!;