Commit c8b23b26 authored by mohammad.salama's avatar mohammad.salama

Added Data Generator so Validatoin can Work , Check Code to see what accounts...

Added Data Generator so Validatoin can Work , Check Code to see what accounts we generated, but it is in the form of (char,number between 1 and 10,mtn & syr)
parent c725dfe1
{
"Version": 1,
"ProjectMap": {
"84a72aeb-6699-44bb-ad4d-91784c1081c6": {
"ProjectGuid": "84a72aeb-6699-44bb-ad4d-91784c1081c6",
"DisplayName": "Data-Generator",
"ColorIndex": 0
},
"a2fe74e1-b743-11d0-ae1a-00a0c90fffc3": {
"ProjectGuid": "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3",
"DisplayName": "Miscellaneous Files",
"ColorIndex": -1
}
},
"NextColorIndex": 1
}
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Data-Generator", "Data-Generator\Data-Generator.csproj", "{84A72AEB-6699-44BB-AD4D-91784C1081C6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{84A72AEB-6699-44BB-AD4D-91784C1081C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84A72AEB-6699-44BB-AD4D-91784C1081C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84A72AEB-6699-44BB-AD4D-91784C1081C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84A72AEB-6699-44BB-AD4D-91784C1081C6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9C4990BB-AA7E-4122-8EB6-9699F483C443}
EndGlobalSection
EndGlobal
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Data_Generator</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.27.0" />
</ItemGroup>
</Project>
using MongoDB.Bson;
using MongoDB.Driver;
class Program
{
static void Main(string[] args)
{
var client = new MongoClient("mongodb://localhost:27020");
var database = client.GetDatabase("AccountsDB");
var collection = database.GetCollection<BsonDocument>("Accounts");
var keys = Builders<BsonDocument>.IndexKeys.Ascending("api-key").Ascending("client-id");
var indexOptions = new CreateIndexOptions { Background = true };
var indexModel = new CreateIndexModel<BsonDocument>(keys, indexOptions);
collection.Indexes.CreateOne(indexModel);
for (char c = 'a'; c <= 'z'; c++)
{
for (int i = 1; i <= 10; i++)
{
string x = c.ToString();
string y = i.ToString();
var document = new BsonDocument
{
{ "api-key", x },
{ "client-id", y },
{ "providers", "mtn , syr"},
};
collection.InsertOne(document);
}
}
// Insert the document into the collection
Console.WriteLine("Document inserted successfully.");
while (true)
{
string apikey, tag;
string number;
Console.WriteLine("Enter : api then number then tag");
apikey = Console.ReadLine();
number = Console.ReadLine();
tag = Console.ReadLine();
var filter = Builders<BsonDocument>.Filter.And(
Builders<BsonDocument>.Filter.Eq("api-key", apikey),
Builders<BsonDocument>.Filter.Eq("client-id", number)
);
var docs = collection.Find(filter).ToList<BsonDocument>();
if (docs.Count == 0)
{
Console.WriteLine("NO");
}
bool ok = false;
foreach (var doc in docs)
{
var tags = (string)doc["providers"];
if (tags.Contains(tag, StringComparison.OrdinalIgnoreCase))
{
Console.WriteLine("Yes for " + tag + " , " + apikey + " , " + number);
ok = true;
}
}
if (!ok)
{
Console.WriteLine("NO");
}
}
}
}
\ No newline at end of file
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
}
}
}
\ No newline at end of file
{
"format": 1,
"restore": {
"D:\\Project\\Message-Priority-Queue\\Data-Generator\\Data-Generator\\Data-Generator.csproj": {}
},
"projects": {
"D:\\Project\\Message-Priority-Queue\\Data-Generator\\Data-Generator\\Data-Generator.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Project\\Message-Priority-Queue\\Data-Generator\\Data-Generator\\Data-Generator.csproj",
"projectName": "Data-Generator",
"projectPath": "D:\\Project\\Message-Priority-Queue\\Data-Generator\\Data-Generator\\Data-Generator.csproj",
"packagesPath": "C:\\Users\\Mr.Salameh\\.nuget\\packages\\",
"outputPath": "D:\\Project\\Message-Priority-Queue\\Data-Generator\\Data-Generator\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\Mr.Salameh\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"dependencies": {
"MongoDB.Driver": {
"target": "Package",
"version": "[2.27.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.100\\RuntimeIdentifierGraph.json"
}
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Mr.Salameh\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.0.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Mr.Salameh\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgAWSSDK_Core Condition=" '$(PkgAWSSDK_Core)' == '' ">C:\Users\Mr.Salameh\.nuget\packages\awssdk.core\3.7.100.14</PkgAWSSDK_Core>
<PkgAWSSDK_SecurityToken Condition=" '$(PkgAWSSDK_SecurityToken)' == '' ">C:\Users\Mr.Salameh\.nuget\packages\awssdk.securitytoken\3.7.100.14</PkgAWSSDK_SecurityToken>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
\ No newline at end of file
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Data-Generator")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Data-Generator")]
[assembly: System.Reflection.AssemblyTitleAttribute("Data-Generator")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
is_global = true
build_property.TargetFramework = net6.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Data_Generator
build_property.ProjectDir = D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\Data-Generator.exe
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\Data-Generator.deps.json
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\Data-Generator.runtimeconfig.json
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\Data-Generator.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\ref\Data-Generator.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\Data-Generator.pdb
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\AWSSDK.Core.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\AWSSDK.SecurityToken.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\DnsClient.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\Microsoft.Extensions.Logging.Abstractions.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\MongoDB.Bson.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\MongoDB.Driver.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\MongoDB.Driver.Core.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\MongoDB.Libmongocrypt.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\SharpCompress.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\Snappier.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\ZstdSharp.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\runtimes\linux\native\libmongocrypt.so
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\runtimes\osx\native\libmongocrypt.dylib
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\bin\Debug\net6.0\runtimes\win\native\mongocrypt.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\obj\Debug\net6.0\Data-Generator.csproj.AssemblyReference.cache
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\obj\Debug\net6.0\Data-Generator.GeneratedMSBuildEditorConfig.editorconfig
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\obj\Debug\net6.0\Data-Generator.AssemblyInfoInputs.cache
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\obj\Debug\net6.0\Data-Generator.AssemblyInfo.cs
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\obj\Debug\net6.0\Data-Generator.csproj.CoreCompileInputs.cache
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\obj\Debug\net6.0\Data-Generator.csproj.CopyComplete
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\obj\Debug\net6.0\Data-Generator.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\obj\Debug\net6.0\ref\Data-Generator.dll
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\obj\Debug\net6.0\Data-Generator.pdb
D:\Project\Message-Priority-Queue\Data-Generator\Data-Generator\obj\Debug\net6.0\Data-Generator.genruntimeconfig.cache
This diff is collapsed.
{
"version": 2,
"dgSpecHash": "H51uRj8W741ZKMs1PJkJhl3a49/nVpbK57vt/W90q7ZpWkrDcVAdkSp8S060k4a6RpvQqTogxZ/sI9ZMvR/+qA==",
"success": true,
"projectFilePath": "D:\\Project\\Message-Priority-Queue\\Data-Generator\\Data-Generator\\Data-Generator.csproj",
"expectedPackageFiles": [
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\awssdk.core\\3.7.100.14\\awssdk.core.3.7.100.14.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\awssdk.securitytoken\\3.7.100.14\\awssdk.securitytoken.3.7.100.14.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\dnsclient\\1.6.1\\dnsclient.1.6.1.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\2.0.0\\microsoft.extensions.logging.abstractions.2.0.0.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\microsoft.netcore.platforms\\5.0.0\\microsoft.netcore.platforms.5.0.0.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\mongodb.bson\\2.27.0\\mongodb.bson.2.27.0.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\mongodb.driver\\2.27.0\\mongodb.driver.2.27.0.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\mongodb.driver.core\\2.27.0\\mongodb.driver.core.2.27.0.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\mongodb.libmongocrypt\\1.10.0\\mongodb.libmongocrypt.1.10.0.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\sharpcompress\\0.30.1\\sharpcompress.0.30.1.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\snappier\\1.0.0\\snappier.1.0.0.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\system.buffers\\4.5.1\\system.buffers.4.5.1.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\system.memory\\4.5.5\\system.memory.4.5.5.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\5.0.0\\system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512",
"C:\\Users\\Mr.Salameh\\.nuget\\packages\\zstdsharp.port\\0.7.3\\zstdsharp.port.0.7.3.nupkg.sha512"
],
"logs": []
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment