nwn-dotnet / nwn.masterlist Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
public async static Task<IOrderedEnumerable<NwServer>> GetAllNwSyncManifestHash(this Client client)
{
return ((IOrderedEnumerable<NwServer>)(await client.GetServers()).Select(x => x.NwSync.Manifests.Where(y => y.Hash != string.Empty))).OrderBy(x => x.ModuleName);
}
[Fact]
public async void TestGetAllNwSyncManifestHash()
{
var collection = await new MasterList.Client().GetAllNwSyncManifestHash();
foreach (var item in collection)
{
//output.WriteLine($"{item.ModuleName} -> {item.NwSync.Manifests}");
}
Assert.NotEmpty(collection);
Assert.NotNull(collection);
}
NWN.MasterList.Test.Client.TestGetAllNwSyncManifestHash:
Outcome: Failed
Error Message:
System.InvalidCastException : Unable to cast object of type 'SelectListIterator2[NWN.MasterList.Data.NwServer,System.Collections.Generic.IEnumerable
1[NWN.MasterList.Data.Manifest]]' to type 'System.Linq.IOrderedEnumerable`1[NWN.MasterList.Data.NwServer]'.
Stack Trace:
at NWN.MasterList.Helper.GetAllNwSyncManifestHash(Client client) in c:\Users\scott\Desktop\NWN.MasterList-1\API\src\Helper.cs:line 115
at NWN.MasterList.Test.Client.TestGetAllNwSyncManifestHash() in c:\Users\scott\Desktop\NWN.MasterList-1\Test\src\Client.Test.cs:line 397
at System.Threading.Tasks.Task.<>c.b__140_0(Object state)
Total tests: 1. Passed: 0. Failed: 1. Skipped: 0
Enforce uniform formatting of code when pushed up via PR, etc. Allow code format to be what the user wants at a local level.
Future enhancement.
NWN.MasterList.Test.Client.TestGetAllElcByType:
Outcome: Failed
Error Message:
System.InvalidCastException : Unable to cast object of type 'SelectIPartitionIterator2[NWN.MasterList.Data.NwServer,System.Boolean]' to type 'System.Linq.IOrderedEnumerable
1[NWN.MasterList.Data.NwServer]'.
Stack Trace:
at NWN.MasterList.Helper.GetAllElcByType(Client client, Boolean setting) in c:\Users\scott\Desktop\NWN.MasterList-1\API\src\Helper.cs:line 41
at NWN.MasterList.Test.Client.TestGetAllElcByType() in c:\Users\scott\Desktop\NWN.MasterList-1\Test\src\Client.Test.cs:line 97
at System.Threading.Tasks.Task.<>c.b__140_0(Object state)
public async static Task<IOrderedEnumerable<NwServer>> GetAllElc(this Client client) =>
(await client.GetServers()).OrderBy(x => x.ELC).ThenBy(x => x.ModuleName);
// TODO #17
public async static Task<IOrderedEnumerable<NwServer>> GetAllElcByType(this Client client, bool setting)
{
var response = await client.GetAllElc();
return (IOrderedEnumerable<NwServer>)response.Select(x => x.Equals(setting));
}
[Fact]
public async void TestGetAllElcByType()
{
var collection = await new MasterList.Client().GetAllElcByType(false);
foreach (var item in collection)
{
output.WriteLine($"{item.ModuleName} -> ELC:{item.ELC}");
}
Assert.NotEmpty(collection);
Assert.NotNull(collection);
}
There is an issue with GetAllElcByType
function and how I am casting (IOrderedEnumerable<NwServer>
result in the return.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.