Found 18 packages
Provides common types for network-based libraries, including System.Net.IPAddress, System.Net.IPEndPoint, and System.Net.CookieContainer. Commonly Used Types: System.Net.HttpStatusCode System.Net.Sockets.SocketError System.Net.Cookie System.Net.Sockets.SocketException System.Net.IPEndPoint System.Net.ICredentials System.Net.NetworkCredential System.Net.IPAddress System.Net.CookieCollection System.Net.CookieContainer When using NuGet 3.x this package requires at least version 3.4.
Internal implementation package not meant for direct consumption. Please do not reference directly. Provides common types for network-based libraries, including System.Net.IPAddress, System.Net.IPEndPoint, and System.Net.CookieContainer. Commonly Used Types: System.Net.HttpStatusCode System.Net.Sockets.SocketError System.Net.Cookie System.Net.Sockets.SocketException System.Net.IPEndPoint System.Net.ICredentials System.Net.NetworkCredential System.Net.IPAddress System.Net.CookieCollection System.Net.CookieContainer When using NuGet 3.x this package requires at least version 3.4.
.NET Standard library with some HTTP related functionality.
AuthorizeAttribute.Extended separates 403 (Forbidden) error code from 401 (Unauthorized) error code based on authentication and/or authorisation result, while ASP.NET's AuthorizeAttribute class only returns 401 (Unauthorized) error code.
Create Standard And Generic Result With HttpStatusCode And Return Standard Result
Method that Send demand of authorization to a server , to get or post requests via Http Rest API method is distributed as a DLL ( library which include this method) Doc at : https://github.com/guihen01/GetHttpResponse/blob/main/README.md
OWIN/Katana Middleware to enforce SSL / https using configurable port and httpstatuscode using http redirect
Middleware that, when included in your Asp.Net Core app, allows you to throw new HttpStatusCodeException() and interrupt the execution of a request while sending back a response with the given Status Code and Body.
1.1.6 1、扩展 ActionContent 的初始化方法(HttpStatusCode)
Extension class for Azure StorageException to extract usefull information embedded inside the StorageException object by Azure Storage services on a failed request. Provides StorageException extension methods to extract: - ErrorCode - ETag - ExtendedErrorMessage - FailedOperationIndex (of a failed Batch Operation) - HttpStatusCode - OperationStartTime (UTC) - OperationEndTime (UTC) - RequestDate (UTC) - RequestId - TargetLocation (Primary, Secondary, etc.) - IsOptimisticConcurrencyFailure And extended ToString() method which automatically extracts this information from the exception instance and converts it into a string for logging purposes. Usage: Try { //Make a request to Azure Table Storage (Blob, Table, Queue, ..) } catch (StorageException storageException) { //Gives you the HttpStatusCode embedded inside the StorageException int? httpStatusCode = storageException.GetHttpStatusCode(); // Gives you the index of the failed operation in a azure table batch operation int failedOperationIndex = storageException.GetFailedOperationIndex(); }
Moksy is an open source .Net library for stubbing, mocking and simulating web services. Intended to be driven from MsTest (or your favorite testing framework), Moksy will create a real HTTP Server end-point that your system under test or other services can hit. For example: Moksy.Common.Proxy proxy = new Moksy.Common.Proxy(10011); proxy.Start(); var simulation = SimulationFactory.When.I.Get().From("/TheEndpoint").Then.Return.Body("Hello World!").And.StatusCode(System.Net.HttpStatusCode.OK); proxy.Add(simulation); Navigating to http://localhost:10011/TheEndpoint in your browser or hitting that Url from another service will return "Hello World!". This release has a strong focus on testing JSON-based web services.
GenKnoToolKit3.0 Concentrado de utilerías y estructura base para desarrollar soluciones de código .Net 4.8,6.0,8.0 ------------------------------------------------------- https://www.fuget.org/packages/Community.Core.EnterpriseLibrary/2.21.7/lib/netcoreapp3.1/Community.Core.EnterpriseLibrary.dll ------------------------------------------------------- 200313 - Integra funcionalidad Core de GenKnoFrame 200416 - Validación opcional ContactLogic > Estado y municipio 200823 - Implementar desconectar conexión en transacciones. 200824 - Upgrade .NetCore 3.1 y .Net Framework 4.8 y retorno soporte MySql 200907 - Utilities > Log > Logger (Considerar campos de Usuario y versión desde configuración inicial) 201027 - Fix LogicBase - Task.Run + Transacction + TimeOut - Problemas con lock en logica 201103 - Fix Filter validar valores null 210415 - Se incluye operaciónes genericas a IRepository por Expressión Lambda. IRepository-Create/Update cambian tipo de retorno Separación IGenericOperations, que implementan Baselogic e IRepository DataColumnAttribute.IColumnConverterType Nuevas operaciones asyc RestClient StringUtility.RandomString, RandomStringSpecial Logger / IEventLogManager.Save(EventLogRequestDto item) --> Request CentralizedLog Pattern.SingleCollectionFactory Utilería EmailSender / EmailGlobalSettings Activation -> Salt + SN + UK (To get a license ContactUs) 210514 Fix ExpressionUtility Activation -> Salt + SN + UK (To get a license ContactUs) Smtp.EnableSsl = EmailGlobalSettings.EnableSsl 210517 Fix Logger - Change SingleInstance by Activator.CreateInstance(EventLogManager.GetType()) 210618 Remove LogicBaseCustomOperation, LogicBaseSimpleOperation 210619 ApiExceptionHandlingMiddleware 210726 Incluir GetCollection tipada por predicado 210813 Include ClaimAuthorizeAttribute alternative to create Policies ApiExceptionHandlingMiddleware - Manage ArgumentException as HttpStatusCode.BadRequest LogicBase - CreateBulkReferenceOperation with Model.Entity.BulkReferenceOperation[TItemId] ObjectEtension - List[TResult] GetDistinct[TSource, TResult](this List[TSource] source, string propertyName) 210813 DataColumnAttribute - ValueConverter PropertyName 210822 RestClient Result decimal convert 220307 Logger.HostName+SaveWarning 220720 .Net 6.0 Support + SQLiteEngine 220721 .Net 6.0 Fix update to AesManaged and Decrypt Read FullBuffer, remove User Entity 220729 Include Namespace EnterpriseLibrary.Storage; Ftp+SFtp+AzureBlob+SharedPoint 230825 ClaimAuthorizeAttribute.isArrayClaimType for support Json Array Claims->options.ClaimActions.MapAll(); Drop ResponseDto->ResponseDto Add PagedSearchDto, ResponsePagedDto SqServerEngine.BulkCopy support for TimeOut and SizeBatch Crypto.EncryptBase64 240506 ClaimAuthorizeAttribute support for .net48 240701 EmailSender remove Constructors, New Sender with attachment collection 240706 Obsolete Predefined models, ReflectionWithDIFactory, clean code and namespaces 240919 Remove Obsolote code Custom Data Type for Create operation Upgrade package references 241024 Deprecate LogManager, Upgrate to ILogger 241030 StorageService with Factory for multi-providers 241109 NewInstance removed 241126 Remove InitObjectNames, change by parameter 250222 Storage GetAsyn prevent Exception, return null 260217 Cambiar Rijndael por AES, Soporte EmailSender via M365.Graph.Application. Se remueve soporte net60 (Prox. Versión se considera net10)
Juhta.Net.WebApi.Exceptions defines Web API exception classes and error response classes for all HTTP client errors (4xx) and server errors (5xx) defined in the System.Net.HttpStatusCode enumeration. This library is a part of Juhta.NET.
*TestBase* gives you a flying start with - fluent assertions that are simple to extend - sharp error messages - tools to help you test with “heavyweight” dependencies on - AspNetCore.Mvc, AspNet.Mvc 3-5, or WebApi Contexts - HttpClient - Ado.Net - Streams & Logging - Mix & match with your favourite test runners & assertions. # TestBase.HttpClient.Fake ``` //Arrange var httpClient = new FakeHttpClient() .SetupGetUrl("https://host.*/").Returns(request=> "Got:" + request.RequestUri) .SetupGetPath("/uri[Pp]attern/").Returns("stringcontent") .SetupPost(".*").Returns(response) .SetupPost(".*", new byte[]{1,2,3}).Returns(otherResponse) .SetupPost(".*", "a=1&b=2") .Returns( request => "You said : " + request.Content.ReadAsStringAsync().ConfigureFalseGetResult(), HttpStatusCode.Accepted) .Setup(x=>x.RequestUri.PathAndQuery.StartsWith("/this")).Returns(response) .Setup(x=>x.Method ==HttpMethod.Put) .Returns(new HttpResponseMessage(HttpStatusCode.Accepted)); // Act var putResponse = await httpClient.PutAsync("http://localhost/thing", new StringContent("{a=1,b=2}")); var postResponse= await httpClient.PostAsync("http://[::1]/", new StringContent("a=1&b=2")); //Debug httpClient.Invocations .ForEach(async i =>Console.WriteLine("{0} {1}",i.RequestUri, await i.Content.ReadAsStringAsync())); //Assert putResponse.StatusCode.ShouldBe(HttpStatusCode.Accepted); postResponse.ShouldBe(response); // ==> SetupPost(".*").Returns(response) was the first // matched setup. Setups are tried in first-to-last order. httpClient.Verify(x=>x.Method ==HttpMethod.Put, "Expected Put, but no matching invocations."); httpClient.Verify( x=>x.Method ==HttpMethod.Post && x.Content.ReadAsStringAsync().ConfigureFalseGetResult()=="a=1&b=2", "Expected Post a=1&b=2"); httpClient.VerifyAll(); // ==> "Exception : 4 unmatched expectations" ``` ### TestBase Chainable fluent assertions get you to the point concisely. ``` UnitUnderTest.Action() .ShouldNotBeNull() .ShouldEqualByValueExceptFor(new {Id=1, Descr=expected}, ignoreList ) .Payload .ShouldMatchIgnoringCase("I expected this") .Should(someOtherPredicate); .ShouldEqualByValue().ShouldEqualByValueExceptFor(...).ShouldEqualByValueOnMembers() work with all kinds of object and collections, and report what differed. string.ShouldMatch(pattern).ShouldNotMatch().ShouldBeEmpty().ShouldNotBeEmpty() .ShouldNotBeNullOrEmptyOrWhiteSpace().ShouldEqualIgnoringCase() .ShouldContain().ShouldStartWith().ShouldEndWith().ShouldBeContainedIn().ShouldBeOneOf().ShouldNotBeOneOf() numeric.ShouldBeBetween().ShouldEqualWithTolerance()....GreaterThan....LessThan...GreaterOrEqualTo ... ienumerable.ShouldAll().ShouldContain().ShouldNotContain().ShouldBeEmpty().ShouldNotBeEmpty() ... stream.ShouldHaveSameStreamContentAs().ShouldContain() value.ShouldBe().ShouldNotBe().ShouldBeOfType().ShouldBeAssignableTo()... .ShouldAll(predicate), .SingleOrAssertFail()... ``` See also - [TestBase](https://www.nuget.org/packages/TestBase) - [TestBase.AspNetCore.Mvc](https://www.nuget.org/packages/TestBase.AspNetCore.Mvc) - [TestBase-Mvc](https://www.nuget.org/packages/TestBase-Mvc) - [TestBase.AdoNet](https://www.nuget.org/packages/TestBase.AdoNet) - [Serilog.Sinks.ListOfString](https://www.nuget.org/packages/Serilog.Sinks.Listofstring) - [Extensions.Logging.ListOfString](https://www.nuget.org/packages/Extensions.Logging.ListOfString)
The purpose of the project is to enable attribute routing and minimizing the code changes with switching between Nancy and ASP.NET WebAPI. Here is some sample usage: [RoutePrefix("api/responseMessage")] public class ResponseMessageModule : ApiController { [HttpGet(nameof(WithStatusCode))] public ResponseMessage<Address> WithStatusCode() { var result = new Address {City = "dummie city"}; return new ResponseMessage<Address>(() => new JsonResponse(result, new JsonNetSerializer()).WithStatusCode(HttpStatusCode.NotModified)); } } [RoutePrefix("api/userApi")] public class UserApi : ApiController { [HttpGet("/")] public IEnumerable<User> GetAll() { return new List<User> { new User(), new User() }; } [HttpGet("/{id}")] public User GetById(int id) { return new User(); } }
HTTP Status Code Lookup is a tool for looking up HTTP status code information. It provides descriptions, categories, and common causes for all standard HTTP status codes from 1xx to 5xx.
Don't spend hours writing code to mock a dozen dependencies, and more hours debugging it. Just write your test code, and let FixtureBase create the dependencies for you. FixtureBase constructs your UnitUnderTest to test your codebase end-to-end, with external dependencies auto-faked and automatically injected in just the right place; even constructor dependencies that are several layers deep. You just write your tests: ``` public class FixtureBaseExample : FixtureBaseWithDbAndHttpFor<AUseCase> { [Fact] public void UUTSendsDataToDb() { var newDatum = new Datum{Id=99, Name="New!" }; UnitUnderTest.InsertDb(newDatum); Db.ShouldHaveInserted("Data",newDatum); } [Fact] public void UUTreturnsDataFromDbQuerySingleColumn() { var dbData = new[] { "row1", "row2", "row3", "row4"}; Db.SetUpForQuerySingleColumn(dbData); UnitUnderTest.FromDbStrings().ShouldEqualByValue(dbData); } [Fact] public async Task UUTGetHttpReturnsDataFromService() { var contentFromService = "IGotThis!"; HttpClient .Setup(m => true) .Returns(new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent(contentFromService)}); (await UnitUnderTest.GetHttp()).ShouldBe(contentFromService); HttpClient.Verify(x=>x.Method==HttpMethod.Get); } } ``` The included examples demonstrate FixtureBases for applications which depend on Ado.Net IDbConnections and on HttpClient network connections. - To create your own FixtureBase with your own preferred Fakes, see the examples at <https://github.com/chrisfcarroll/ActivateAnything/blob/master/FixtureBase/FixtureExample.cs.md> - For how it's done, see <https://github.com/chrisfcarroll/ActivateAnything/blob/master/FixtureBase/FixtureBase.cs> Construction is done by - [ActivateAnything](https://www.nuget.org/packages/ActivateAnything) Faking is done by - [TestBase.AdoNet](https://www.nuget.org/packages/TestBase.AdoNet) - [TestBase.HttpClient.Fake](https://www.nuget.org/packages/TestBase.HttpClient.Fake) For more tools focussed on cutting the cost of unit testing, see also: - [TestBase](https://www.nuget.org/packages/TestBase) - [TestBase.AspNetCore.Mvc](https://www.nuget.org/packages/TestBase.AspNetCore.Mvc) - [TestBase-Mvc](https://www.nuget.org/packages/TestBase-Mvc) - [TestBase.AdoNet](https://www.nuget.org/packages/TestBase.AdoNet) - [TestBase.HttpClient.Fake](https://www.nuget.org/packages/TestBase.HttpClient.Fake) - [Serilog.Sinks.ListOfString](https://www.nuget.org/packages/Serilog.Sinks.Listofstring) - [Extensions.Logging.ListOfString](https://www.nuget.org/packages/Extensions.Logging.ListOfString)