Modernize tests, remove Tester project, and automate amalgamation pipeline
This commit is contained in:
@@ -1,63 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A64D2052-D0CD-488E-BF05-E5952615D926}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AmalgamationTool</RootNamespace>
|
||||
<AssemblyName>AmalgamationTool</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Compile Remove="DynamORM.Amalgamation.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DynamORM.Amalgamation.cs">
|
||||
<ExcludeFromStyleCop>True</ExcludeFromStyleCop>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,192 +1,261 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace AmalgamationTool
|
||||
namespace AmalgamationTool;
|
||||
|
||||
internal static class Program
|
||||
{
|
||||
internal class Program
|
||||
private const string NamespaceToken = "namespace ";
|
||||
|
||||
private static int Main(string[] args)
|
||||
{
|
||||
private static void Main(string[] args)
|
||||
if (args.Length < 2)
|
||||
{
|
||||
List<string> usings = new List<string>();
|
||||
Dictionary<string, List<string>> classes = new Dictionary<string, List<string>>();
|
||||
Console.Error.WriteLine("Usage: AmalgamationTool <sourceDir> <outputFile>");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Build a file using string builder.
|
||||
StringBuilder sb = new StringBuilder();
|
||||
var sourceDir = Path.GetFullPath(args[0].Trim('"', '\''));
|
||||
var outputFile = Path.GetFullPath(args[1].Trim('"', '\''));
|
||||
|
||||
foreach (var f in new DirectoryInfo(Path.GetFullPath(args[0].Trim('"', '\''))).GetFiles("*.cs", SearchOption.AllDirectories))
|
||||
if (!Directory.Exists(sourceDir))
|
||||
{
|
||||
string content = File.ReadAllText(f.FullName);
|
||||
Console.Error.WriteLine($"Source directory not found: {sourceDir}");
|
||||
return 2;
|
||||
}
|
||||
|
||||
string namespaceName = string.Empty;
|
||||
var allUsings = new SortedSet<string>(StringComparer.Ordinal);
|
||||
var namespaces = new SortedDictionary<string, List<string>>(StringComparer.Ordinal);
|
||||
var headerComment = string.Empty;
|
||||
|
||||
// Deal with usings
|
||||
foreach (var u in content.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)
|
||||
.Where(l => l.Trim().StartsWith("using ") && !l.Trim().StartsWith("using ("))
|
||||
.Select(l => l.Trim()))
|
||||
if (!usings.Contains(u))
|
||||
usings.Add(u);
|
||||
|
||||
// Extract namespace
|
||||
|
||||
//if (args.Length > 2)
|
||||
//{
|
||||
// var tcontent = Regex.Replace(content, @"^\s*using\s+.*\s*;$", string.Empty);
|
||||
// tcontent = Regex.Replace(content, @"^\s*namespace\s+.*\s*", string.Empty).Trim();
|
||||
|
||||
// var ns = Regex.Match(content, @"^\s*namespace\s+(?<ns>.*)\s*");
|
||||
|
||||
// if (ns.Success)
|
||||
// {
|
||||
// if (!classes.ContainsKey(ns.Groups["ns"].Value))
|
||||
// classes.Add(ns.Groups["ns"].Value, new List<string>());
|
||||
|
||||
// classes[ns.Groups["ns"].Value].Add(tcontent);
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
foreach (var file in EnumerateInputFiles(sourceDir))
|
||||
{
|
||||
var content = File.ReadAllText(file);
|
||||
if (string.IsNullOrWhiteSpace(content))
|
||||
{
|
||||
if (content.Trim().Length == 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
var nstart = content.IndexOf("namespace ") + "namespace ".Length;
|
||||
var bbrace = content.IndexOf("{", nstart);
|
||||
var nlen = bbrace - nstart;
|
||||
if (string.IsNullOrEmpty(headerComment))
|
||||
{
|
||||
headerComment = TryGetFileHeaderComment(content);
|
||||
}
|
||||
|
||||
if (nstart < "namespace ".Length)
|
||||
foreach (var @using in ExtractUsingLines(content))
|
||||
{
|
||||
if (f.Name.ToLower() == "assemblyinfo.cs")
|
||||
allUsings.Add(@using);
|
||||
}
|
||||
|
||||
var nsData = TryExtractNamespaceBody(content);
|
||||
if (nsData == null)
|
||||
{
|
||||
var hs = content.IndexOf("/*");
|
||||
var es = content.IndexOf("*/", hs) + 2;
|
||||
if (es > hs)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!namespaces.TryGetValue(nsData.Value.Namespace, out var nodes))
|
||||
{
|
||||
sb.AppendLine(content.Substring(hs, es - hs));
|
||||
nodes = new List<string>();
|
||||
namespaces[nsData.Value.Namespace] = nodes;
|
||||
}
|
||||
|
||||
nodes.Add(nsData.Value.Body);
|
||||
}
|
||||
|
||||
var output = BuildAmalgamation(headerComment, allUsings, namespaces);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(outputFile) ?? ".");
|
||||
File.WriteAllText(outputFile, output, new UTF8Encoding(false));
|
||||
|
||||
Console.WriteLine($"Amalgamation generated: {outputFile}");
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static IEnumerable<string> EnumerateInputFiles(string sourceDir)
|
||||
{
|
||||
var root = new DirectoryInfo(sourceDir);
|
||||
return root.EnumerateFiles("*.cs", SearchOption.AllDirectories)
|
||||
.Where(f => !f.FullName.Contains($"{Path.DirectorySeparatorChar}bin{Path.DirectorySeparatorChar}", StringComparison.OrdinalIgnoreCase))
|
||||
.Where(f => !f.FullName.Contains($"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}", StringComparison.OrdinalIgnoreCase))
|
||||
.Where(f => !f.Name.Equals("AssemblyInfo.cs", StringComparison.OrdinalIgnoreCase))
|
||||
.Where(f => !f.Name.Equals("DynamORM.Amalgamation.cs", StringComparison.OrdinalIgnoreCase))
|
||||
.Select(f => f.FullName)
|
||||
.OrderBy(f => f, StringComparer.Ordinal);
|
||||
}
|
||||
|
||||
private static IEnumerable<string> ExtractUsingLines(string content)
|
||||
{
|
||||
var matches = Regex.Matches(content, @"^\s*using\s+[^;]+;", RegexOptions.Multiline);
|
||||
foreach (Match match in matches)
|
||||
{
|
||||
var line = match.Value.Trim();
|
||||
if (!line.StartsWith("using (", StringComparison.Ordinal))
|
||||
{
|
||||
yield return line;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static (string Namespace, string Body)? TryExtractNamespaceBody(string content)
|
||||
{
|
||||
var nsIndex = content.IndexOf(NamespaceToken, StringComparison.Ordinal);
|
||||
if (nsIndex < 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var nsStart = nsIndex + NamespaceToken.Length;
|
||||
var braceStart = content.IndexOf('{', nsStart);
|
||||
if (braceStart < 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var namespaceName = content.Substring(nsStart, braceStart - nsStart).Trim();
|
||||
if (string.IsNullOrWhiteSpace(namespaceName))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var braceEnd = FindMatchingBrace(content, braceStart);
|
||||
if (braceEnd <= braceStart)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var body = content.Substring(braceStart + 1, braceEnd - braceStart - 1).Trim('\r', '\n');
|
||||
return (namespaceName, body);
|
||||
}
|
||||
|
||||
private static int FindMatchingBrace(string content, int openBrace)
|
||||
{
|
||||
var depth = 0;
|
||||
for (var i = openBrace; i < content.Length; i++)
|
||||
{
|
||||
switch (content[i])
|
||||
{
|
||||
case '{':
|
||||
depth++;
|
||||
break;
|
||||
case '}':
|
||||
depth--;
|
||||
if (depth == 0)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
private static string TryGetFileHeaderComment(string content)
|
||||
{
|
||||
var match = Regex.Match(content, @"^\s*/\*.*?\*/", RegexOptions.Singleline);
|
||||
return match.Success ? match.Value.Trim() : string.Empty;
|
||||
}
|
||||
|
||||
private static string BuildAmalgamation(
|
||||
string headerComment,
|
||||
IEnumerable<string> allUsings,
|
||||
SortedDictionary<string, List<string>> namespaces)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
if (!string.IsNullOrWhiteSpace(headerComment))
|
||||
{
|
||||
sb.AppendLine(headerComment);
|
||||
sb.AppendLine();
|
||||
}
|
||||
|
||||
foreach (var @using in allUsings)
|
||||
{
|
||||
sb.AppendLine(@using);
|
||||
}
|
||||
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("[module: System.Diagnostics.CodeAnalysis.SuppressMessage(\"StyleCop.CSharp.MaintainabilityRules\", \"SA1402:FileMayOnlyContainASingleClass\", Justification = \"This is a generated file which generates all the necessary support classes.\")]");
|
||||
sb.AppendLine("[module: System.Diagnostics.CodeAnalysis.SuppressMessage(\"StyleCop.CSharp.MaintainabilityRules\", \"SA1403:FileMayOnlyContainASingleNamespace\", Justification = \"This is a generated file which generates all the necessary support classes.\")]");
|
||||
sb.AppendLine();
|
||||
|
||||
FillNamespaceTree(namespaces, sb);
|
||||
return CleanupWhitespace(sb.ToString());
|
||||
}
|
||||
|
||||
private static void FillNamespaceTree(SortedDictionary<string, List<string>> classes, StringBuilder sb)
|
||||
{
|
||||
var minDepth = classes.Keys.Min(k => k.Split('.').Length);
|
||||
|
||||
foreach (var root in classes.Where(c => c.Key.Split('.').Length == minDepth))
|
||||
{
|
||||
sb.AppendLine($"namespace {root.Key}");
|
||||
sb.AppendLine("{");
|
||||
|
||||
foreach (var code in root.Value)
|
||||
{
|
||||
sb.AppendLine(code);
|
||||
}
|
||||
|
||||
FillSubNamespaces(classes, root.Key, minDepth, sb);
|
||||
sb.AppendLine("}");
|
||||
sb.AppendLine();
|
||||
}
|
||||
}
|
||||
|
||||
private static void FillSubNamespaces(
|
||||
SortedDictionary<string, List<string>> classes,
|
||||
string parent,
|
||||
int depth,
|
||||
StringBuilder sb)
|
||||
{
|
||||
foreach (var child in classes.Where(c => c.Key.StartsWith(parent + ".", StringComparison.Ordinal) && c.Key.Split('.').Length == depth + 1))
|
||||
{
|
||||
var indent = new string(' ', depth * 4);
|
||||
var shortNamespace = child.Key.Substring(parent.Length + 1);
|
||||
sb.Append(indent).AppendLine($"namespace {shortNamespace}");
|
||||
sb.Append(indent).AppendLine("{");
|
||||
|
||||
foreach (var block in child.Value)
|
||||
{
|
||||
foreach (var line in block.Replace("\r\n", "\n").Split('\n'))
|
||||
{
|
||||
sb.Append(indent).Append(" ").AppendLine(line);
|
||||
}
|
||||
}
|
||||
|
||||
FillSubNamespaces(classes, child.Key, depth + 1, sb);
|
||||
sb.Append(indent).AppendLine("}");
|
||||
sb.AppendLine();
|
||||
}
|
||||
}
|
||||
|
||||
private static string CleanupWhitespace(string content)
|
||||
{
|
||||
var lines = content.Replace("\r\n", "\n").Split('\n');
|
||||
var output = new StringBuilder();
|
||||
string? previous = null;
|
||||
|
||||
for (var i = 0; i < lines.Length; i++)
|
||||
{
|
||||
var current = lines[i];
|
||||
var trimmed = current.Trim();
|
||||
var nextTrimmed = i + 1 < lines.Length ? lines[i + 1].Trim() : null;
|
||||
|
||||
if (string.IsNullOrEmpty(trimmed))
|
||||
{
|
||||
if (string.IsNullOrEmpty(previous))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string ns = content.Substring(nstart, nlen).Trim();
|
||||
|
||||
// Add namespace if not exist
|
||||
if (!classes.ContainsKey(ns))
|
||||
classes.Add(ns, new List<string>());
|
||||
|
||||
var ebrace = content.LastIndexOf('}');
|
||||
|
||||
// Cut content as class/enum
|
||||
classes[ns].Add(content.Substring(bbrace + 1, ebrace - bbrace - 1));
|
||||
}
|
||||
}
|
||||
|
||||
usings.Sort();
|
||||
|
||||
foreach (var u in usings)
|
||||
sb.AppendLine(u);
|
||||
|
||||
sb.AppendLine(@"
|
||||
[module: System.Diagnostics.CodeAnalysis.SuppressMessage(""StyleCop.CSharp.MaintainabilityRules"", ""SA1402:FileMayOnlyContainASingleClass"", Justification = ""This is a generated file which generates all the necessary support classes."")]
|
||||
[module: System.Diagnostics.CodeAnalysis.SuppressMessage(""StyleCop.CSharp.MaintainabilityRules"", ""SA1403:FileMayOnlyContainASingleNamespace"", Justification = ""This is a generated file which generates all the necessary support classes."")]");
|
||||
|
||||
FillClassesAndNamespacesIddented(classes, sb);
|
||||
|
||||
string amalgamation = sb.ToString();
|
||||
|
||||
sb = new StringBuilder();
|
||||
|
||||
string prevTrimmed = null;
|
||||
|
||||
string[] array = amalgamation.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
if (previous == "{" || previous == "}" || nextTrimmed == "}" || string.IsNullOrEmpty(nextTrimmed))
|
||||
{
|
||||
string l = array[i];
|
||||
var currentTrimmed = l.Trim();
|
||||
var nextTrimmed = (i + 1 == array.Length) ? null : array[i + 1].Trim();
|
||||
|
||||
if (prevTrimmed != null)
|
||||
{
|
||||
switch (prevTrimmed)
|
||||
{
|
||||
case "":
|
||||
if (currentTrimmed == string.Empty)
|
||||
continue;
|
||||
break;
|
||||
|
||||
case "{":
|
||||
case "}":
|
||||
if (currentTrimmed == string.Empty && (nextTrimmed == prevTrimmed || nextTrimmed == string.Empty))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sb.AppendLine(l);
|
||||
prevTrimmed = currentTrimmed;
|
||||
output.AppendLine(current.TrimEnd());
|
||||
previous = trimmed;
|
||||
}
|
||||
|
||||
File.WriteAllText(Path.GetFullPath(args[1].Trim('"', '\'')), sb.ToString());
|
||||
}
|
||||
|
||||
private static void FillClassesAndNamespaces(Dictionary<string, List<string>> classes, StringBuilder sb)
|
||||
{
|
||||
foreach (var n in classes)
|
||||
{
|
||||
sb.AppendFormat("namespace {0}{1}{{", n.Key, Environment.NewLine);
|
||||
n.Value.ForEach(c => sb.Append(c));
|
||||
sb.AppendLine("}");
|
||||
sb.AppendLine(string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private static void FillClassesAndNamespacesIddented(Dictionary<string, List<string>> classes, StringBuilder sb)
|
||||
{
|
||||
var min = classes.Min(k => k.Key.Split('.').Count());
|
||||
|
||||
foreach (var n in classes.Where(nc => nc.Key.Split('.').Count() == min))
|
||||
{
|
||||
sb.AppendFormat("namespace {0}{1}{{", n.Key, Environment.NewLine);
|
||||
n.Value.ForEach(c => sb.Append(c));
|
||||
|
||||
SubNamespaces(classes, n.Key, sb, min);
|
||||
|
||||
sb.AppendLine("}");
|
||||
sb.AppendLine(string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SubNamespaces(Dictionary<string, List<string>> classes, string p, StringBuilder sb, int ident)
|
||||
{
|
||||
sb.AppendLine(string.Empty);
|
||||
|
||||
foreach (var n in classes.Where(nc => nc.Key.Split('.').Count() == ident + 1 && nc.Key.StartsWith(p)))
|
||||
{
|
||||
for (int i = 0; i < ident; i++) sb.Append(" ");
|
||||
sb.AppendFormat("namespace {0}{1}", n.Key.Substring(p.Length + 1), Environment.NewLine);
|
||||
|
||||
for (int i = 0; i < ident; i++) sb.Append(" ");
|
||||
sb.Append("{");
|
||||
n.Value.ForEach(c =>
|
||||
{
|
||||
foreach (var l in c.Split(new string[] { Environment.NewLine }, StringSplitOptions.None))
|
||||
{
|
||||
for (int i = 0; i < ident; i++) sb.Append(" ");
|
||||
sb.AppendLine(l);
|
||||
}
|
||||
});
|
||||
|
||||
SubNamespaces(classes, n.Key, sb, ident + 1);
|
||||
|
||||
for (int i = 0; i < ident; i++) sb.Append(" ");
|
||||
sb.AppendLine("}");
|
||||
sb.AppendLine(string.Empty);
|
||||
}
|
||||
}
|
||||
return output.ToString();
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("AmalgamationTool")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("AmalgamationTool")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("de540809-dd27-47b1-bb01-7dce3a880cde")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -26,10 +26,10 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1"/>
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.1.1"/>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.4"/>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
|
||||
<PackageReference Include="NUnit" Version="3.14.0"/>
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0"/>
|
||||
<PackageReference Include="System.Data.SQLite" Version="1.0.119" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -28,16 +28,16 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Helpers
|
||||
{
|
||||
/// <summary>Class responsible for users operations testing.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class AttachToDebugger
|
||||
{
|
||||
/// <summary>Test anonymous type compatibility.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestAnonType()
|
||||
{
|
||||
var a = new { x = 1, y = 2 };
|
||||
@@ -47,7 +47,7 @@ namespace DynamORM.Tests.Helpers
|
||||
}
|
||||
|
||||
/// <summary>Test anonymous type value.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestAnonTypeValue()
|
||||
{
|
||||
var a = new { x = 1, y = "bla bla" };
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -28,18 +28,18 @@
|
||||
|
||||
using System;
|
||||
using DynamORM.Helpers.Dynamics;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Helpers.Dynamic
|
||||
{
|
||||
/// <summary><see cref="DynamicParser"/> tests.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class DynamicParserTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Tests the get member.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestGetMember()
|
||||
{
|
||||
Func<dynamic, object> f = x => x.SomePropery;
|
||||
@@ -53,7 +53,7 @@ namespace DynamORM.Tests.Helpers.Dynamic
|
||||
/// <summary>
|
||||
/// Tests the set member.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSetMember()
|
||||
{
|
||||
Func<dynamic, object> f = x => x.SomePropery = "value";
|
||||
@@ -68,7 +68,7 @@ namespace DynamORM.Tests.Helpers.Dynamic
|
||||
/// <summary>
|
||||
/// Tests the index of the get.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestGetIndex()
|
||||
{
|
||||
Func<dynamic, object> f = x => x.SomePropery[0];
|
||||
@@ -81,7 +81,7 @@ namespace DynamORM.Tests.Helpers.Dynamic
|
||||
/// <summary>
|
||||
/// Tests the index of the set.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSetIndex()
|
||||
{
|
||||
Func<dynamic, object> f = x => x.SomePropery[0] = "value";
|
||||
@@ -95,7 +95,7 @@ namespace DynamORM.Tests.Helpers.Dynamic
|
||||
/// <summary>
|
||||
/// Tests something.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSomething()
|
||||
{
|
||||
Func<dynamic, object> f = x => x.SomePropery == "value" || x.OtherProperty == -1;
|
||||
@@ -111,8 +111,8 @@ namespace DynamORM.Tests.Helpers.Dynamic
|
||||
Assert.IsNotNull(left);
|
||||
Assert.IsNotNull(right);
|
||||
|
||||
Assert.IsInstanceOfType(left.Host, typeof(DynamicParser.Node.GetMember));
|
||||
Assert.IsInstanceOfType(right.Host, typeof(DynamicParser.Node.GetMember));
|
||||
Assert.IsInstanceOf<DynamicParser.Node.GetMember>(left.Host);
|
||||
Assert.IsInstanceOf<DynamicParser.Node.GetMember>(right.Host);
|
||||
|
||||
Assert.AreEqual("value", left.Right);
|
||||
Assert.AreEqual(-1, right.Right);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -26,23 +26,23 @@
|
||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Helpers
|
||||
{
|
||||
/// <summary>Pooling tests.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class PoolingTests : TestsBase
|
||||
{
|
||||
/// <summary>Setup test parameters.</summary>
|
||||
[TestInitialize]
|
||||
[SetUp]
|
||||
public virtual void SetUp()
|
||||
{
|
||||
CreateTestDatabase();
|
||||
}
|
||||
|
||||
/// <summary>Tear down test objects.</summary>
|
||||
[TestCleanup]
|
||||
[TearDown]
|
||||
public virtual void TearDown()
|
||||
{
|
||||
DestroyDynamicDatabase();
|
||||
@@ -50,7 +50,7 @@ namespace DynamORM.Tests.Helpers
|
||||
}
|
||||
|
||||
/// <summary>Test single mode command disposing.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSingleModeCommand()
|
||||
{
|
||||
CreateDynamicDatabase();
|
||||
@@ -62,11 +62,11 @@ namespace DynamORM.Tests.Helpers
|
||||
Database.Dispose();
|
||||
Database = null;
|
||||
|
||||
Assert.ThrowsException<DynamicQueryException>(() => cmd.ExecuteScalar());
|
||||
Assert.Throws<DynamicQueryException>(() => cmd.ExecuteScalar());
|
||||
}
|
||||
|
||||
/// <summary>Test single mode transaction disposing.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSingleModeTransaction()
|
||||
{
|
||||
try
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -28,11 +28,11 @@
|
||||
|
||||
using DynamORM.Mapper;
|
||||
using DynamORM.Validation;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Helpers.Validation
|
||||
{
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class ObjectValidationTest
|
||||
{
|
||||
public class TestObject
|
||||
@@ -48,7 +48,7 @@ namespace DynamORM.Tests.Helpers.Validation
|
||||
public decimal[] ArrayTest { get; set; }
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void ValidateCorrectObject()
|
||||
{
|
||||
var result = DynamicMapperCache.GetMapper<TestObject>().ValidateObject(
|
||||
@@ -62,7 +62,7 @@ namespace DynamORM.Tests.Helpers.Validation
|
||||
Assert.AreEqual(0, result.Count);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void ValidateIncorrectObject()
|
||||
{
|
||||
var result = DynamicMapperCache.GetMapper<TestObject>().ValidateObject(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -28,16 +28,16 @@
|
||||
|
||||
using System;
|
||||
using DynamORM.Tests.Helpers;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Modify
|
||||
{
|
||||
/// <summary>Test standard dynamic access ORM.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class DynamicModificationTests : TestsBase
|
||||
{
|
||||
/// <summary>Setup test parameters.</summary>
|
||||
[TestInitialize]
|
||||
[SetUp]
|
||||
public virtual void SetUp()
|
||||
{
|
||||
CreateTestDatabase();
|
||||
@@ -45,7 +45,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Tear down test objects.</summary>
|
||||
[TestCleanup]
|
||||
[TearDown]
|
||||
public virtual void TearDown()
|
||||
{
|
||||
DestroyDynamicDatabase();
|
||||
@@ -62,7 +62,7 @@ namespace DynamORM.Tests.Modify
|
||||
#region Insert
|
||||
|
||||
/// <summary>Test row insertion by dynamic arguments.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInsertByArguments()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Insert(code: "201", first: null, last: "Gagarin", email: "juri.gagarin@megacorp.com", quote: "bla, bla, bla"));
|
||||
@@ -79,7 +79,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row insertion by dynamic object.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInsertByDynamicObjects()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Insert(values: new { code = "202", first = DBNull.Value, last = "Gagarin", email = "juri.gagarin@megacorp.com", quote = "bla, bla, bla" }));
|
||||
@@ -96,7 +96,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row insertion by mapped object.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInsertByMappedObject()
|
||||
{
|
||||
var u = GetTestTable();
|
||||
@@ -123,7 +123,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row insertion by basic object.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInsertByBasicObject()
|
||||
{
|
||||
var u = GetTestTable();
|
||||
@@ -154,7 +154,7 @@ namespace DynamORM.Tests.Modify
|
||||
#region Update
|
||||
|
||||
/// <summary>Test row updating by dynamic arguments.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateByArguments()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Update(id: 1, code: "201", first: null, last: "Gagarin", email: "juri.gagarin@megacorp.com", quote: "bla, bla, bla"));
|
||||
@@ -171,7 +171,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row updating by dynamic objects.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateByDynamicObject()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Update(update: new { id = 2, code = "202", first = DBNull.Value, last = "Gagarin", email = "juri.gagarin@megacorp.com", quote = "bla, bla, bla" }));
|
||||
@@ -188,7 +188,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row updating by mapped object.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateByMappedObject()
|
||||
{
|
||||
var u = GetTestTable();
|
||||
@@ -215,7 +215,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row updating by basic object.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateByBasicObject()
|
||||
{
|
||||
var u = GetTestTable();
|
||||
@@ -242,7 +242,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row updating by dynamic objects.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateByDynamicObjects()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Update(values: new { code = "205", first = DBNull.Value, last = "Gagarin", email = "juri.gagarin@megacorp.com", quote = "bla, bla, bla" }, where: new { id = 5 }));
|
||||
@@ -259,7 +259,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row updating by mapped objects.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateByMappedObjects()
|
||||
{
|
||||
var u = GetTestTable();
|
||||
@@ -286,7 +286,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row updating by basic objects.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateByBasicObjects()
|
||||
{
|
||||
var u = GetTestTable();
|
||||
@@ -317,7 +317,7 @@ namespace DynamORM.Tests.Modify
|
||||
#region Delete
|
||||
|
||||
/// <summary>Test row deleting by dynamic arguments.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestDeleteByArguments()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Delete(code: "10"));
|
||||
@@ -327,7 +327,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row deleting by dynamic objects (all except ID should be ignored).</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestDeleteyDynamicObject()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Delete(delete: new { id = 11, code = 11, first = "Juri", last = "Gagarin", email = "juri.gagarin@megacorp.com", quote = "bla, bla, bla" }));
|
||||
@@ -337,7 +337,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row deleting by mapped object.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestDeleteByMappedObject()
|
||||
{
|
||||
var u = GetTestTable();
|
||||
@@ -357,7 +357,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row deleting by basic object.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestDeleteByBasicObject()
|
||||
{
|
||||
var u = GetTestTable();
|
||||
@@ -377,7 +377,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Test row deleting by dynamic objects (all except ID should be ignored).</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestDeleteyDynamicObjectWhere()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Delete(where: new { id = 14, code = "14" }));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -26,17 +26,17 @@
|
||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Modify
|
||||
{
|
||||
/// <summary>Test standard dynamic access ORM. With out schema information from database.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class DynamicNoSchemaModificationTests : DynamicModificationTests
|
||||
{
|
||||
/// <summary>Setup test parameters.</summary>
|
||||
[TestInitialize]
|
||||
public virtual void SetUp()
|
||||
[SetUp]
|
||||
public override void SetUp()
|
||||
{
|
||||
CreateTestDatabase();
|
||||
CreateDynamicDatabase(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -28,12 +28,12 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using DynamORM.Tests.Helpers;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Modify
|
||||
{
|
||||
/// <summary>Test standard dynamic access ORM. With out schema information from database.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class DynamicTypeSchemaModificationTests : DynamicModificationTests
|
||||
{
|
||||
/// <summary>Create table using specified method.</summary>
|
||||
@@ -46,7 +46,7 @@ namespace DynamORM.Tests.Modify
|
||||
/// <summary>
|
||||
/// Tests the bulk insert.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestBulkInsert()
|
||||
{
|
||||
Assert.AreEqual(2, Database.Insert<users>(new List<users>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -29,7 +29,7 @@
|
||||
using System.Linq;
|
||||
using DynamORM.Builders;
|
||||
using DynamORM.Builders.Implementation;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
using DynamORM.Tests.Helpers;
|
||||
using System.Collections.Generic;
|
||||
using static System.Data.Entity.Infrastructure.Design.Executor;
|
||||
@@ -38,11 +38,11 @@ using System.Runtime.InteropServices;
|
||||
namespace DynamORM.Tests.Modify
|
||||
{
|
||||
/// <summary>New parser tests.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class ParserTests : TestsBase
|
||||
{
|
||||
/// <summary>Setup test parameters.</summary>
|
||||
[TestInitialize]
|
||||
[SetUp]
|
||||
public virtual void SetUp()
|
||||
{
|
||||
CreateTestDatabase();
|
||||
@@ -53,7 +53,7 @@ namespace DynamORM.Tests.Modify
|
||||
}
|
||||
|
||||
/// <summary>Tear down test objects.</summary>
|
||||
[TestCleanup]
|
||||
[TearDown]
|
||||
public virtual void TearDown()
|
||||
{
|
||||
DestroyDynamicDatabase();
|
||||
@@ -65,7 +65,7 @@ namespace DynamORM.Tests.Modify
|
||||
/// <summary>
|
||||
/// Tests the basic insert.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInsertBasic()
|
||||
{
|
||||
IDynamicInsertQueryBuilder cmd = new DynamicInsertQueryBuilder(Database, "Users");
|
||||
@@ -79,7 +79,7 @@ namespace DynamORM.Tests.Modify
|
||||
/// <summary>
|
||||
/// Tests the insert with sub query.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInsertSubQuery()
|
||||
{
|
||||
IDynamicInsertQueryBuilder cmd = new DynamicInsertQueryBuilder(Database, "Users");
|
||||
@@ -96,7 +96,7 @@ namespace DynamORM.Tests.Modify
|
||||
/// <summary>
|
||||
/// Tests the basic insert using object.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInsertBasicObject()
|
||||
{
|
||||
IDynamicInsertQueryBuilder cmd = new DynamicInsertQueryBuilder(Database, "Users");
|
||||
@@ -110,7 +110,7 @@ namespace DynamORM.Tests.Modify
|
||||
/// <summary>
|
||||
/// Tests the insert using object with sub query.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInsertSubQueryObject()
|
||||
{
|
||||
IDynamicInsertQueryBuilder cmd = new DynamicInsertQueryBuilder(Database, "Users");
|
||||
@@ -136,7 +136,7 @@ namespace DynamORM.Tests.Modify
|
||||
/// <summary>
|
||||
/// Tests the basic update.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateBasicSet()
|
||||
{
|
||||
IDynamicUpdateQueryBuilder cmd = new DynamicUpdateQueryBuilder(Database, "Users");
|
||||
@@ -151,7 +151,7 @@ namespace DynamORM.Tests.Modify
|
||||
/// <summary>
|
||||
/// Tests the basic update.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateBasicValues()
|
||||
{
|
||||
IDynamicUpdateQueryBuilder cmd = new DynamicUpdateQueryBuilder(Database, "Users");
|
||||
@@ -169,7 +169,7 @@ namespace DynamORM.Tests.Modify
|
||||
/// <summary>
|
||||
/// Tests the insert with sub query.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateSubQuery()
|
||||
{
|
||||
IDynamicUpdateQueryBuilder cmd = new DynamicUpdateQueryBuilder(Database, "Users");
|
||||
@@ -186,7 +186,7 @@ namespace DynamORM.Tests.Modify
|
||||
/// <summary>
|
||||
/// Tests the basic insert using object.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateBasicObject()
|
||||
{
|
||||
IDynamicUpdateQueryBuilder cmd = new DynamicUpdateQueryBuilder(Database, "Users");
|
||||
@@ -201,7 +201,7 @@ namespace DynamORM.Tests.Modify
|
||||
/// <summary>
|
||||
/// Tests the basic insert using object.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUpdateSubQueryObject()
|
||||
{
|
||||
IDynamicUpdateQueryBuilder cmd = new DynamicUpdateQueryBuilder(Database, "Users");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -30,16 +30,16 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DynamORM.Builders;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Select
|
||||
{
|
||||
/// <summary>Test standard dynamic access ORM.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class DynamicAccessTests : TestsBase
|
||||
{
|
||||
/// <summary>Setup test parameters.</summary>
|
||||
[TestInitialize]
|
||||
[SetUp]
|
||||
public virtual void SetUp()
|
||||
{
|
||||
CreateTestDatabase();
|
||||
@@ -47,7 +47,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Tear down test objects.</summary>
|
||||
[TestCleanup]
|
||||
[TearDown]
|
||||
public virtual void TearDown()
|
||||
{
|
||||
DestroyDynamicDatabase();
|
||||
@@ -71,28 +71,28 @@ namespace DynamORM.Tests.Select
|
||||
#region Select
|
||||
|
||||
/// <summary>Test unknown op.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestUnknownOperation()
|
||||
{
|
||||
Assert.ThrowsException<InvalidOperationException>(() => GetTestTable().MakeMeASandwitch(with: "cheese"));
|
||||
Assert.Throws<InvalidOperationException>(() => GetTestTable().MakeMeASandwitch(with: "cheese"));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Count</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestCount()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Count(columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Count</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestCount2()
|
||||
{
|
||||
Assert.AreEqual(200L, GetTestBuilder().Select(x => x.Count(x.id)).Scalar());
|
||||
}
|
||||
|
||||
/// <summary>Test count with in statement.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectInEnumerableCount()
|
||||
{
|
||||
Assert.AreEqual(4, GetTestTable().Count(last: new DynamicColumn
|
||||
@@ -103,7 +103,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test count with in statement.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectInEnumerableCount2()
|
||||
{
|
||||
Assert.AreEqual(4L, GetTestBuilder()
|
||||
@@ -113,7 +113,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test count with in statement.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectInArrayCount()
|
||||
{
|
||||
Assert.AreEqual(4, GetTestTable().Count(last: new DynamicColumn
|
||||
@@ -124,7 +124,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test count with in statement.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectInArrayCount2()
|
||||
{
|
||||
Assert.AreEqual(4L, GetTestBuilder()
|
||||
@@ -134,14 +134,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>First</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFirst()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().First(columns: "id").id);
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>First</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFirst2()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestBuilder()
|
||||
@@ -151,14 +151,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Last</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestLast()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Last(columns: "id").id);
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Last</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestLast2()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestBuilder()
|
||||
@@ -168,14 +168,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Count</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestCountSpecificRecord()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Count(first: "Ori"));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Count</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestCountSpecificRecord2()
|
||||
{
|
||||
Assert.AreEqual(1L, GetTestBuilder()
|
||||
@@ -185,14 +185,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestMin()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Min(columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestMin2()
|
||||
{
|
||||
Assert.AreEqual(1L, GetTestBuilder()
|
||||
@@ -201,14 +201,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestMax()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Max(columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestMax2()
|
||||
{
|
||||
Assert.AreEqual(200L, GetTestBuilder()
|
||||
@@ -217,14 +217,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TesttAvg()
|
||||
{
|
||||
Assert.AreEqual(100.5, GetTestTable().Avg(columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TesttAvg2()
|
||||
{
|
||||
Assert.AreEqual(100.5, GetTestBuilder()
|
||||
@@ -233,14 +233,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Sum</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSum()
|
||||
{
|
||||
Assert.AreEqual(20100, GetTestTable().Sum(columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Sum</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSum2()
|
||||
{
|
||||
Assert.AreEqual(20100L, GetTestBuilder()
|
||||
@@ -249,21 +249,21 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Scalar</c> method for invalid operation exception.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestScalarException()
|
||||
{
|
||||
Assert.ThrowsException<InvalidOperationException>(() => GetTestTable().Scalar(id: 19));
|
||||
Assert.Throws<InvalidOperationException>(() => GetTestTable().Scalar(id: 19));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Scalar</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestScalar()
|
||||
{
|
||||
Assert.AreEqual("Ori", GetTestTable().Scalar(columns: "first", id: 19));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Scalar</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestScalar2()
|
||||
{
|
||||
Assert.AreEqual("Ori", GetTestBuilder()
|
||||
@@ -273,7 +273,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Scalar</c> method with SQLite specific aggregate.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestScalarGroupConcat()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
@@ -283,7 +283,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Scalar</c> method with SQLite specific aggregate.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestScalarGroupConcat2()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
@@ -296,7 +296,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Scalar</c> method with SQLite specific aggregate not using aggregate field.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestScalarGroupConcatNoAggregateField()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
@@ -306,7 +306,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Scalar</c> method with SQLite specific aggregate not using aggregate field.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestScalarGroupConcatNoAggregateField2()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
@@ -319,7 +319,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") occurs from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFancyAggregateQuery()
|
||||
{
|
||||
var v = (GetTestTable().Query(columns: "first,first:occurs:count", group: "first", order: ":desc:2") as IEnumerable<dynamic>).ToList();
|
||||
@@ -334,7 +334,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") occurs from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFancyAggregateQuery2()
|
||||
{
|
||||
var v = GetTestBuilder()
|
||||
@@ -354,14 +354,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "users";</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestAggregateInAggregate()
|
||||
{
|
||||
Assert.AreEqual(12.77, GetTestTable().Scalar(columns: @"length(""login""):len:avg"));
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "users";</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestAggregateInAggregate2()
|
||||
{
|
||||
Assert.AreEqual(12.77, GetTestBuilder()
|
||||
@@ -370,14 +370,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "users";</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestAggregateInAggregateMark2()
|
||||
{
|
||||
Assert.AreEqual(27.7, GetTestTable().Avg(columns: @"length(""email""):len"));
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "users";</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestAggregateInAggregateMark3()
|
||||
{
|
||||
Assert.AreEqual(27.7, GetTestBuilder()
|
||||
@@ -409,7 +409,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Single</c> multi.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSingleObject()
|
||||
{
|
||||
var exp = new { id = 19, first = "Ori", last = "Ellis" };
|
||||
@@ -421,7 +421,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic <c>Single</c> multi.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSingleObject2()
|
||||
{
|
||||
var exp = new { id = 19, first = "Ori", last = "Ellis" };
|
||||
@@ -437,10 +437,10 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic duplicate column name occurrence.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestDuplicateColumnNameException()
|
||||
{
|
||||
Assert.ThrowsException<ArgumentException>(() => GetTestBuilder()
|
||||
Assert.Throws<ArgumentException>(() => GetTestBuilder()
|
||||
.Where(x => x.id == 19)
|
||||
.Select(x => new
|
||||
{
|
||||
@@ -458,14 +458,14 @@ namespace DynamORM.Tests.Select
|
||||
#region Where
|
||||
|
||||
/// <summary>Test dynamic where expression equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereEq()
|
||||
{
|
||||
Assert.AreEqual("hoyt.tran", GetTestTable().Single(where: new DynamicColumn("id").Eq(100)).login);
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereEq2()
|
||||
{
|
||||
Assert.AreEqual("hoyt.tran", GetTestBuilder()
|
||||
@@ -473,14 +473,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression not equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereNot()
|
||||
{
|
||||
Assert.AreEqual(199, GetTestTable().Count(where: new DynamicColumn("id").Not(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression not equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereNot2()
|
||||
{
|
||||
Assert.AreEqual(199L, GetTestBuilder()
|
||||
@@ -490,14 +490,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereLike()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Single(where: new DynamicColumn("login").Like("Hoyt.%")).id);
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereLike2()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestBuilder()
|
||||
@@ -505,14 +505,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression not like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereNotLike()
|
||||
{
|
||||
Assert.AreEqual(199, GetTestTable().Count(where: new DynamicColumn("login").NotLike("Hoyt.%")));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression not like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereNotLike2()
|
||||
{
|
||||
Assert.AreEqual(199L, GetTestBuilder()
|
||||
@@ -522,7 +522,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression not like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereNotLike3()
|
||||
{
|
||||
Assert.AreEqual(199L, GetTestBuilder()
|
||||
@@ -532,14 +532,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression greater.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereGt()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Count(where: new DynamicColumn("id").Greater(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression greater.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereGt2()
|
||||
{
|
||||
Assert.AreEqual(100L, GetTestBuilder()
|
||||
@@ -549,14 +549,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression greater or equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereGte()
|
||||
{
|
||||
Assert.AreEqual(101, GetTestTable().Count(where: new DynamicColumn("id").GreaterOrEqual(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression greater or equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereGte2()
|
||||
{
|
||||
Assert.AreEqual(101L, GetTestBuilder()
|
||||
@@ -566,14 +566,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression less.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereLt()
|
||||
{
|
||||
Assert.AreEqual(99, GetTestTable().Count(where: new DynamicColumn("id").Less(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression less.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereLt2()
|
||||
{
|
||||
Assert.AreEqual(99L, GetTestBuilder()
|
||||
@@ -583,14 +583,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression less or equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereLte()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Count(where: new DynamicColumn("id").LessOrEqual(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression less or equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereLte2()
|
||||
{
|
||||
Assert.AreEqual(100L, GetTestBuilder()
|
||||
@@ -600,14 +600,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression between.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereBetween()
|
||||
{
|
||||
Assert.AreEqual(26, GetTestTable().Count(where: new DynamicColumn("id").Between(75, 100)));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression between.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereBetween2()
|
||||
{
|
||||
Assert.AreEqual(26L, GetTestBuilder()
|
||||
@@ -617,21 +617,21 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression in parameters.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereIn1()
|
||||
{
|
||||
Assert.AreEqual(3, GetTestTable().Count(where: new DynamicColumn("id").In(75, 99, 100)));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression in array.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereIn2()
|
||||
{
|
||||
Assert.AreEqual(3, GetTestTable().Count(where: new DynamicColumn("id").In(new[] { 75, 99, 100 })));
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression in parameters.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereIn3()
|
||||
{
|
||||
Assert.AreEqual(3L, GetTestBuilder()
|
||||
@@ -641,7 +641,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test dynamic where expression in parameters.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereIn4()
|
||||
{
|
||||
Assert.AreEqual(3L, GetTestBuilder()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -26,16 +26,16 @@
|
||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Select
|
||||
{
|
||||
/// <summary>Test standard dynamic access ORM. With out schema information from database.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class DynamicNoSchemaAccessTests : DynamicAccessTests
|
||||
{
|
||||
/// <summary>Setup test parameters.</summary>
|
||||
[TestInitialize]
|
||||
[SetUp]
|
||||
public override void SetUp()
|
||||
{
|
||||
CreateTestDatabase();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -27,12 +27,12 @@
|
||||
*/
|
||||
|
||||
using DynamORM.Tests.Helpers;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Select
|
||||
{
|
||||
/// <summary>Test standard dynamic access ORM. With out schema information from database.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class DynamicTypeSchemaAccessTests : DynamicNoSchemaAccessTests
|
||||
{
|
||||
/// <summary>Create table using specified method.</summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -29,16 +29,16 @@
|
||||
using System.Linq;
|
||||
using DynamORM.Builders;
|
||||
using DynamORM.Builders.Implementation;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Select
|
||||
{
|
||||
/// <summary>Tests of legacy parser methods.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class LegacyParserTests : TestsBase
|
||||
{
|
||||
/// <summary>Setup test parameters.</summary>
|
||||
[TestInitialize]
|
||||
[SetUp]
|
||||
public virtual void SetUp()
|
||||
{
|
||||
CreateTestDatabase();
|
||||
@@ -49,7 +49,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Tear down test objects.</summary>
|
||||
[TestCleanup]
|
||||
[TearDown]
|
||||
public virtual void TearDown()
|
||||
{
|
||||
DestroyDynamicDatabase();
|
||||
@@ -59,7 +59,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression equal.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereEq()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -73,7 +73,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression equal with brackets.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereBracketsEq()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -88,7 +88,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression equal with brackets and or condition.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereBracketsOrEq()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -103,7 +103,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression equal with brackets.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereBracketsOrEq2()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -120,7 +120,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression equal with brackets.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereBracketsOrEqForgotToEnd()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -139,7 +139,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression not equal.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereNotEq()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -153,7 +153,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression greater.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereGreater()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -167,7 +167,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression greater or equal.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereGreaterOrEqual()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -181,7 +181,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression less.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereLess()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -195,7 +195,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression less or equal.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereLessOrEqual()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -209,7 +209,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression like.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereLike()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -223,7 +223,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression not like.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereNotLike()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -237,7 +237,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression between.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereBetween()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -251,7 +251,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression in.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereIn()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -265,7 +265,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the where expression using anonymous types.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereAnon()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -279,7 +279,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the order by column.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestOrderByCol()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -293,7 +293,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the order by column number.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestOrderByNum()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -307,7 +307,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests the group by column.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestGroupByCol()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -30,18 +30,18 @@ using System.Linq;
|
||||
using DynamORM.Builders;
|
||||
using DynamORM.Builders.Implementation;
|
||||
using DynamORM.Tests.Helpers;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Select
|
||||
{
|
||||
/// <summary>
|
||||
/// New parser tests.
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class ParserTests : TestsBase
|
||||
{
|
||||
/// <summary>Setup test parameters.</summary>
|
||||
[TestInitialize]
|
||||
[SetUp]
|
||||
public virtual void SetUp()
|
||||
{
|
||||
CreateTestDatabase();
|
||||
@@ -53,7 +53,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Tear down test objects.</summary>
|
||||
[TestCleanup]
|
||||
[TearDown]
|
||||
public virtual void TearDown()
|
||||
{
|
||||
try
|
||||
@@ -67,7 +67,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromGet()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -79,7 +79,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from typed method.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromGetTyped()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = Database.From<Users>();
|
||||
@@ -90,7 +90,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from typed method.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromGetTypedAs()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = Database.From<Users>("u");
|
||||
@@ -101,7 +101,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method with multi tables.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromGetMultiKulti()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -113,7 +113,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method with as expression in text.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromGetAs1()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -125,7 +125,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method with as expression in text.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromGetAsNoLock1()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -137,7 +137,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method with as expression using lambda.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromGetAs2()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -149,7 +149,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using text.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromText()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -161,7 +161,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using text with decorators.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromDecoratedText()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -173,7 +173,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using text with as.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromTextAs1()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -185,7 +185,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using invoke with as.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromTextAs2()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -198,7 +198,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using invoke with as.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromTextAs3()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -211,7 +211,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using invoke with sub query.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromSubQuery1()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -224,7 +224,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using invoke with sub query.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromSubQuery2()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -237,7 +237,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using invoke with sub query.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromSubQuery3()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -250,7 +250,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using invoke with sub query.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestFromSubQuery4()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -263,7 +263,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests where method with alias.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereAlias()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -277,7 +277,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests where method with alias.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestHavingAlias()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -291,7 +291,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests complex where method with alias.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereAliasComplex()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -307,7 +307,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests where method with alias using in.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereAliasIn()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -327,7 +327,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests where method with alias using between.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereAliasBetween1()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -347,7 +347,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests where method with alias using between.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereAliasBetween2()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -367,7 +367,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests where method without alias.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereNoAlias()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -381,7 +381,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests where method with full column name.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestWhereNoAliasTableName()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -395,7 +395,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests simple join method.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestJoinClassic()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -409,7 +409,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests inner join method.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInnerJoin()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -423,7 +423,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests inner join method with aliases mix.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInnerJoin2()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -438,7 +438,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using invoke with sub query.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInnerJoin3()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -453,7 +453,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using invoke with sub query.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInnerJoin4()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -468,7 +468,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests from method using invoke with sub query an no lock.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInnerJoin5()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -483,7 +483,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests inner join method with no lock.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestInnerJoin6()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -497,7 +497,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests left outer join method.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestLeftOuterJoin()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -511,7 +511,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests left join method.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestLeftJoin()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -525,7 +525,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests right outer join method.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestRightOuterJoin()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -539,7 +539,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests right join method.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestRightJoin()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -553,7 +553,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests complex join with parameters.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestJoinClassicWithParamAndWhere()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -569,7 +569,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select all.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectAll1()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -583,7 +583,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select all.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectAll2()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -597,7 +597,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select field.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectField1()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -611,7 +611,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select field.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectField2()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -625,7 +625,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select field with alias.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectFieldAlias1()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -639,7 +639,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select field with alias.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectFieldAlias2()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -653,7 +653,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select field with alias.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectFieldAlias3()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -667,7 +667,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select field with alias.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectFieldAlias4()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -681,7 +681,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select aggregate field with alias (Sum).
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectAggregateField1()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -695,7 +695,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select aggregate field with alias (Coalesce).
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectAggregateField2()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -710,7 +710,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select aggregate field with alias (Sum).
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectAggregateField3()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -724,7 +724,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select aggregate field with alias (Sum).
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectAggregateField4()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -738,7 +738,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select aggregate field with alias (Sum).
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectAggregateField5()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -752,7 +752,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select from anonymous type.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectAnon()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -770,7 +770,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select escaped case.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectCaseEscaped1()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -785,7 +785,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select escaped case.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectCaseEscaped2()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -800,7 +800,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select escaped case.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestCoalesceEscaped()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -815,7 +815,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select escaped case.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestCoalesce()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -830,7 +830,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select escaped case.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestCoalesceCalculatedArgs()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -849,7 +849,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select escaped case.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestCoalesceInWhere()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -865,7 +865,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests select escaped case with sub query.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSelectCaseEscapedAndSub()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -883,7 +883,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests group by.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestGroupBy()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -897,7 +897,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests order by.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestOrderBy()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -911,7 +911,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests order by using string with number.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestOrderByNumberedColumnStr()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -925,7 +925,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests order by using member with number.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestOrderByNumberedColFn()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -939,7 +939,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests order by using member with field.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestOrderByAlt()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -953,7 +953,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests sub query select.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSubQuerySelect()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -970,7 +970,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests sub query where.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSubQueryWhere()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -987,7 +987,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests sub query in.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSubQueryWhereIn()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
@@ -1004,7 +1004,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <summary>
|
||||
/// Tests sub query join.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestSubQueryJoin()
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = new DynamicSelectQueryBuilder(Database);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -29,16 +29,16 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DynamORM.Tests.Helpers;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Select
|
||||
{
|
||||
/// <summary>Test typed ORM.</summary>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class RenamedTypedAccessTests : TypedAccessTests<Users>
|
||||
{
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestTypedFancyAggregateQuery()
|
||||
{
|
||||
var v = (GetTestTable().Query(type: typeof(Users), columns: "first,first:AggregateField:count", group: "first", order: ":desc:2") as IEnumerable<dynamic>).ToList();
|
||||
@@ -53,7 +53,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestGenericFancyAggregateQuery()
|
||||
{
|
||||
var v = (GetTestTable().Query<Users>(columns: "first,first:AggregateField:count", group: "first", order: ":desc:2") as IEnumerable<dynamic>).ToList();
|
||||
@@ -68,21 +68,21 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>First</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestTypedFirst()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().First(type: typeof(Users), columns: "id").Id);
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Last</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestTypedLast()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Last(type: typeof(Users), columns: "id").Id);
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Single</c> multi.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestTypedSingleObject()
|
||||
{
|
||||
var exp = new { id = 19, first = "Ori", last = "Ellis" };
|
||||
@@ -94,35 +94,35 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestTypedWhereEq()
|
||||
{
|
||||
Assert.AreEqual("hoyt.tran", GetTestTable().Single(type: typeof(Users), where: new DynamicColumn("id").Eq(100)).Login);
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestTypedWhereLike()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Single(type: typeof(Users), where: new DynamicColumn("login").Like("Hoyt.%")).Id);
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>First</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestGenericFirst()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().First<Users>(columns: "id").Id);
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Last</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestGenericLast()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Last<Users>(columns: "id").Id);
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Single</c> multi.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestGenericSingleObject()
|
||||
{
|
||||
var exp = new { id = 19, first = "Ori", last = "Ellis" };
|
||||
@@ -134,14 +134,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestGenericWhereEq()
|
||||
{
|
||||
Assert.AreEqual("hoyt.tran", GetTestTable().Single<Users>(where: new DynamicColumn("id").Eq(100)).Login);
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public override void TestGenericWhereLike()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Single<Users>(where: new DynamicColumn("login").Like("Hoyt.%")).Id);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* DynamORM - Dynamic Object-Relational Mapping library.
|
||||
* Copyright (c) 2012-2026, Grzegorz Russek (grzegorz.russek@gmail.com)
|
||||
* All rights reserved.
|
||||
@@ -31,17 +31,17 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DynamORM.Builders;
|
||||
using DynamORM.Tests.Helpers;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DynamORM.Tests.Select
|
||||
{
|
||||
/// <summary>Test typed ORM.</summary>
|
||||
/// <typeparam name="T">Type to test.</typeparam>
|
||||
[TestClass]
|
||||
[TestFixture]
|
||||
public class TypedAccessTests<T> : TestsBase where T : class
|
||||
{
|
||||
/// <summary>Setup test parameters.</summary>
|
||||
[TestInitialize]
|
||||
[SetUp]
|
||||
public virtual void SetUp()
|
||||
{
|
||||
CreateTestDatabase();
|
||||
@@ -49,7 +49,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Tear down test objects.</summary>
|
||||
[TestCleanup]
|
||||
[TearDown]
|
||||
public virtual void TearDown()
|
||||
{
|
||||
DestroyDynamicDatabase();
|
||||
@@ -73,7 +73,7 @@ namespace DynamORM.Tests.Select
|
||||
#region Select typed
|
||||
|
||||
/// <summary>Test load all rows into mapped list alternate way.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedGetAll()
|
||||
{
|
||||
var list = (GetTestTable().Query(type: typeof(T)) as IEnumerable<object>).Cast<T>().ToList();
|
||||
@@ -82,7 +82,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test load all rows into mapped list alternate way.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedGetAll2()
|
||||
{
|
||||
var list = GetTestBuilder()
|
||||
@@ -95,7 +95,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test load all rows into mapped list alternate way.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedGetAll3()
|
||||
{
|
||||
var list = GetTestBuilder()
|
||||
@@ -107,21 +107,21 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test unknown op.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedUnknownOperation()
|
||||
{
|
||||
Assert.ThrowsException<InvalidOperationException>(() => GetTestTable().MakeMeASandwitch(type: typeof(T), with: "cheese"));
|
||||
Assert.Throws<InvalidOperationException>(() => GetTestTable().MakeMeASandwitch(type: typeof(T), with: "cheese"));
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Count</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedCount()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Count(type: typeof(T), columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Count</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedCount2()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestBuilder()
|
||||
@@ -131,7 +131,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test count with in statement.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedSelectInEnumerableCount()
|
||||
{
|
||||
Assert.AreEqual(4, GetTestTable().Count(type: typeof(T), last: new DynamicColumn
|
||||
@@ -142,7 +142,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test count with in statement.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedSelectInEnumerableCount2()
|
||||
{
|
||||
Assert.AreEqual(4, GetTestBuilder()
|
||||
@@ -153,7 +153,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test count with in statement.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedSelectInArrayCount()
|
||||
{
|
||||
Assert.AreEqual(4, GetTestTable().Count(type: typeof(T), last: new DynamicColumn
|
||||
@@ -164,7 +164,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test count with in statement.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedSelectInArrayCount2()
|
||||
{
|
||||
Assert.AreEqual(4, GetTestBuilder()
|
||||
@@ -175,14 +175,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>First</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedFirst()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().First(type: typeof(T), columns: "id").id);
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>First</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedFirst2()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestBuilder()
|
||||
@@ -193,14 +193,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Last</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedLast()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Last(type: typeof(T), columns: "id").id);
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Last</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedLast2()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestBuilder()
|
||||
@@ -211,21 +211,21 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Count</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedCountSpecificRecord()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Count(type: typeof(T), first: "Ori"));
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedMin()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Min(type: typeof(T), columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedMin2()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestBuilder()
|
||||
@@ -235,14 +235,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedMax()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Max(type: typeof(T), columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedMax2()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestBuilder()
|
||||
@@ -252,14 +252,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedtAvg()
|
||||
{
|
||||
Assert.AreEqual(100.5, GetTestTable().Avg(type: typeof(T), columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedtAvg2()
|
||||
{
|
||||
Assert.AreEqual(100.5, GetTestBuilder()
|
||||
@@ -269,14 +269,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Sum</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedSum()
|
||||
{
|
||||
Assert.AreEqual(20100, GetTestTable().Sum(type: typeof(T), columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Sum</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedSum2()
|
||||
{
|
||||
Assert.AreEqual(20100, GetTestBuilder()
|
||||
@@ -286,21 +286,21 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Scalar</c> method for invalid operation exception.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedScalarException()
|
||||
{
|
||||
Assert.ThrowsException<InvalidOperationException>(() => GetTestTable().Scalar(type: typeof(T), id: 19));
|
||||
Assert.Throws<InvalidOperationException>(() => GetTestTable().Scalar(type: typeof(T), id: 19));
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Scalar</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedScalar()
|
||||
{
|
||||
Assert.AreEqual("Ori", GetTestTable().Scalar(type: typeof(T), columns: "first", id: 19));
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Scalar</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void TestTypedScalar2()
|
||||
{
|
||||
Assert.AreEqual("Ori", GetTestBuilder()
|
||||
@@ -311,7 +311,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Scalar</c> method with SQLite specific aggregate.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedScalarGroupConcat()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
@@ -321,7 +321,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Scalar</c> method with SQLite specific aggregate.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedScalarGroupConcat2()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
@@ -335,7 +335,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Scalar</c> method with SQLite specific aggregate not using aggregate field.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedScalarGroupConcatNoAggregateField()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
@@ -345,7 +345,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Scalar</c> method with SQLite specific aggregate not using aggregate field.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedScalarGroupConcatNoAggregateField2()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
@@ -359,7 +359,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedFancyAggregateQuery()
|
||||
{
|
||||
var v = (GetTestTable().Query(type: typeof(T), columns: "first,first:aggregatefield:count", group: "first", order: ":desc:2") as IEnumerable<dynamic>).ToList();
|
||||
@@ -374,7 +374,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedFancyAggregateQuery2()
|
||||
{
|
||||
var v = GetTestBuilder()
|
||||
@@ -395,14 +395,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "users";</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedAggregateInAggregate()
|
||||
{
|
||||
Assert.AreEqual(12.77, GetTestTable().Scalar(type: typeof(T), columns: @"length(""login""):len:avg"));
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "users";</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedAggregateInAggregate2()
|
||||
{
|
||||
Assert.AreEqual(12.77, GetTestBuilder()
|
||||
@@ -412,14 +412,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "users";</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedAggregateInAggregateMark2()
|
||||
{
|
||||
Assert.AreEqual(27.7, GetTestTable().Avg(type: typeof(T), columns: @"length(""email""):len"));
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "users";</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedAggregateInAggregateMark3()
|
||||
{
|
||||
Assert.AreEqual(27.7, GetTestBuilder()
|
||||
@@ -453,7 +453,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Single</c> multi.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedSingleObject()
|
||||
{
|
||||
var exp = new { id = 19, first = "Ori", last = "Ellis" };
|
||||
@@ -465,7 +465,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Single</c> multi.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedSingleObject2()
|
||||
{
|
||||
var exp = new { id = 19, first = "Ori", last = "Ellis" };
|
||||
@@ -486,14 +486,14 @@ namespace DynamORM.Tests.Select
|
||||
#region Where typed
|
||||
|
||||
/// <summary>Test typed where expression equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereEq()
|
||||
{
|
||||
Assert.AreEqual("hoyt.tran", GetTestTable().Single(type: typeof(T), where: new DynamicColumn("id").Eq(100)).login);
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereEq2()
|
||||
{
|
||||
Assert.AreEqual("hoyt.tran", GetTestBuilder()
|
||||
@@ -502,14 +502,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression not equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereNot()
|
||||
{
|
||||
Assert.AreEqual(199, GetTestTable().Count(type: typeof(T), where: new DynamicColumn("id").Not(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression not equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereNot2()
|
||||
{
|
||||
Assert.AreEqual(199, GetTestBuilder()
|
||||
@@ -520,14 +520,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereLike()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Single(type: typeof(T), where: new DynamicColumn("login").Like("Hoyt.%")).id);
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereLike2()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestBuilder()
|
||||
@@ -536,14 +536,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression not like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereNotLike()
|
||||
{
|
||||
Assert.AreEqual(199, GetTestTable().Count(type: typeof(T), where: new DynamicColumn("login").NotLike("Hoyt.%")));
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression not like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereNotLike2()
|
||||
{
|
||||
Assert.AreEqual(199, GetTestBuilder()
|
||||
@@ -554,7 +554,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression not like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereNotLike3()
|
||||
{
|
||||
Assert.AreEqual(199, GetTestBuilder()
|
||||
@@ -565,14 +565,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression greater.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereGt()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Count(type: typeof(T), where: new DynamicColumn("id").Greater(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression greater.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereGt2()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestBuilder()
|
||||
@@ -583,14 +583,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression greater or equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereGte()
|
||||
{
|
||||
Assert.AreEqual(101, GetTestTable().Count(type: typeof(T), where: new DynamicColumn("id").GreaterOrEqual(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression greater or equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereGte2()
|
||||
{
|
||||
Assert.AreEqual(101, GetTestBuilder()
|
||||
@@ -601,14 +601,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression less.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereLt()
|
||||
{
|
||||
Assert.AreEqual(99, GetTestTable().Count(type: typeof(T), where: new DynamicColumn("id").Less(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression less.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereLt2()
|
||||
{
|
||||
Assert.AreEqual(99, GetTestBuilder()
|
||||
@@ -619,14 +619,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression less or equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereLte()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Count(type: typeof(T), where: new DynamicColumn("id").LessOrEqual(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression less or equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereLte2()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestBuilder()
|
||||
@@ -637,14 +637,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression between.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereBetween()
|
||||
{
|
||||
Assert.AreEqual(26, GetTestTable().Count(type: typeof(T), where: new DynamicColumn("id").Between(75, 100)));
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression between.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereBetween2()
|
||||
{
|
||||
Assert.AreEqual(26, GetTestBuilder()
|
||||
@@ -655,21 +655,21 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression in parameters.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereIn1()
|
||||
{
|
||||
Assert.AreEqual(3, GetTestTable().Count(type: typeof(T), where: new DynamicColumn("id").In(75, 99, 100)));
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression in array.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereIn2()
|
||||
{
|
||||
Assert.AreEqual(3, GetTestTable().Count(type: typeof(T), where: new DynamicColumn("id").In(new[] { 75, 99, 100 })));
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression in parameters.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereIn3()
|
||||
{
|
||||
Assert.AreEqual(3, GetTestBuilder()
|
||||
@@ -680,7 +680,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression in array.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestTypedWhereIn4()
|
||||
{
|
||||
Assert.AreEqual(3, GetTestBuilder()
|
||||
@@ -695,7 +695,7 @@ namespace DynamORM.Tests.Select
|
||||
#region Select generic
|
||||
|
||||
/// <summary>Test load all rows into mapped list alternate way.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericGetAll()
|
||||
{
|
||||
var list = (GetTestTable().Query<T>() as IEnumerable<object>).Cast<T>().ToList();
|
||||
@@ -704,21 +704,21 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test unknown op.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericUnknownOperation()
|
||||
{
|
||||
Assert.ThrowsException<InvalidOperationException>(() => GetTestTable().MakeMeASandwitch<T>(with: "cheese"));
|
||||
Assert.Throws<InvalidOperationException>(() => GetTestTable().MakeMeASandwitch<T>(with: "cheese"));
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Count</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericCount()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Count<T>(columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test count with in statement.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericSelectInEnumerableCount()
|
||||
{
|
||||
Assert.AreEqual(4, GetTestTable().Count<T>(last: new DynamicColumn
|
||||
@@ -729,7 +729,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test count with in statement.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericSelectInArrayCount()
|
||||
{
|
||||
Assert.AreEqual(4, GetTestTable().Count<T>(last: new DynamicColumn
|
||||
@@ -740,70 +740,70 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>First</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericFirst()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().First<T>(columns: "id").id);
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Last</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericLast()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Last<T>(columns: "id").id);
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Count</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericCountSpecificRecord()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Count<T>(first: "Ori"));
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericMin()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().Min<T>(columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericMax()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Max<T>(columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Min</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenerictAvg()
|
||||
{
|
||||
Assert.AreEqual(100.5, GetTestTable().Avg<T>(columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Sum</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericSum()
|
||||
{
|
||||
Assert.AreEqual(20100, GetTestTable().Sum<T>(columns: "id"));
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Scalar</c> method for invalid operation exception.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericScalarException()
|
||||
{
|
||||
Assert.ThrowsException<InvalidOperationException>(() => GetTestTable().Scalar<T>(id: 19));
|
||||
Assert.Throws<InvalidOperationException>(() => GetTestTable().Scalar<T>(id: 19));
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Scalar</c> method.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericScalar()
|
||||
{
|
||||
Assert.AreEqual("Ori", GetTestTable().Scalar<T>(columns: "first", id: 19));
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Scalar</c> method with SQLite specific aggregate.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericScalarGroupConcat()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
@@ -813,7 +813,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Scalar</c> method with SQLite specific aggregate not using aggregate field.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericScalarGroupConcatNoAggregateField()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
@@ -823,7 +823,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericFancyAggregateQuery()
|
||||
{
|
||||
var v = (GetTestTable().Query<T>(columns: "first,first:aggregatefield:count", group: "first", order: ":desc:2") as IEnumerable<dynamic>).ToList();
|
||||
@@ -838,14 +838,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "users";</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericAggregateInAggregate()
|
||||
{
|
||||
Assert.AreEqual(12.77, GetTestTable().Scalar<T>(columns: @"length(""login""):len:avg"));
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "users";</code>.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericAggregateInAggregateMark2()
|
||||
{
|
||||
Assert.AreEqual(27.7, GetTestTable().Avg<T>(columns: @"length(""email""):len"));
|
||||
@@ -866,7 +866,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Single</c> multi.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericSingleObject()
|
||||
{
|
||||
var exp = new { id = 19, first = "Ori", last = "Ellis" };
|
||||
@@ -882,77 +882,77 @@ namespace DynamORM.Tests.Select
|
||||
#region Where generic
|
||||
|
||||
/// <summary>Test generic where expression equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericWhereEq()
|
||||
{
|
||||
Assert.AreEqual("hoyt.tran", GetTestTable().Single<T>(where: new DynamicColumn("id").Eq(100)).login);
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression not equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericWhereNot()
|
||||
{
|
||||
Assert.AreEqual(199, GetTestTable().Count<T>(where: new DynamicColumn("id").Not(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericWhereLike()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Single<T>(where: new DynamicColumn("login").Like("Hoyt.%")).id);
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression not like.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericWhereNotLike()
|
||||
{
|
||||
Assert.AreEqual(199, GetTestTable().Count<T>(where: new DynamicColumn("login").NotLike("Hoyt.%")));
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression greater.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericWhereGt()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Count<T>(where: new DynamicColumn("id").Greater(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression greater or equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericWhereGte()
|
||||
{
|
||||
Assert.AreEqual(101, GetTestTable().Count<T>(where: new DynamicColumn("id").GreaterOrEqual(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression less.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericWhereLt()
|
||||
{
|
||||
Assert.AreEqual(99, GetTestTable().Count<T>(where: new DynamicColumn("id").Less(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression less or equal.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericWhereLte()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Count<T>(where: new DynamicColumn("id").LessOrEqual(100)));
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression between.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericWhereBetween()
|
||||
{
|
||||
Assert.AreEqual(26, GetTestTable().Count<T>(where: new DynamicColumn("id").Between(75, 100)));
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression in parameters.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericWhereIn1()
|
||||
{
|
||||
Assert.AreEqual(3, GetTestTable().Count<T>(where: new DynamicColumn("id").In(75, 99, 100)));
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression in array.</summary>
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public virtual void TestGenericWhereIn2()
|
||||
{
|
||||
Assert.AreEqual(3, GetTestTable().Count<T>(where: new DynamicColumn("id").In(new[] { 75, 99, 100 })));
|
||||
|
||||
41
DynamORM.sln
41
DynamORM.sln
@@ -7,9 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamORM", "DynamORM\DynamO
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamORM.Tests", "DynamORM.Tests\DynamORM.Tests.csproj", "{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmalgamationTool", "AmalgamationTool\AmalgamationTool.csproj", "{A64D2052-D0CD-488E-BF05-E5952615D926}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tester", "Tester\Tester.csproj", "{F747AA57-BEA7-4FB8-B371-546296789AEF}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AmalgamationTool", "AmalgamationTool\AmalgamationTool.csproj", "{A64D2052-D0CD-488E-BF05-E5952615D926}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -41,29 +39,18 @@ Global
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|x86.Build.0 = Debug|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|Any CPU.Build.0 = Release|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|x86.ActiveCfg = Release|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|x86.Build.0 = Release|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Debug|x86.Build.0 = Debug|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|x86.ActiveCfg = Release|x86
|
||||
{F747AA57-BEA7-4FB8-B371-546296789AEF}.Release|x86.Build.0 = Release|x86
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{A64D2052-D0CD-488E-BF05-E5952615D926}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -72,6 +59,6 @@ Global
|
||||
SolutionGuid = {22781EB3-2148-4CA4-845A-B55265A7B5C2}
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = Tester\Tester.csproj
|
||||
StartupItem = DynamORM.Tests\DynamORM.Tests.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GenerateAmalgamationOnBuild>true</GenerateAmalgamationOnBuild>
|
||||
<AmalgamationSourceDir>$(MSBuildProjectDirectory)</AmalgamationSourceDir>
|
||||
<AmalgamationOutputFile>$(MSBuildProjectDirectory)\..\AmalgamationTool\DynamORM.Amalgamation.cs</AmalgamationOutputFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
@@ -25,4 +31,11 @@
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(MSBuildRuntimeType)' == 'Core' AND '$(OS)' != 'Windows_NT'">
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="GenerateAmalgamation"
|
||||
AfterTargets="Build"
|
||||
Condition="'$(GenerateAmalgamationOnBuild)' == 'true' and '$(TargetFramework)' == 'net10.0' and '$(IsCrossTargetingBuild)' != 'true'">
|
||||
<Message Importance="high" Text="Generating amalgamation file to $(AmalgamationOutputFile)" />
|
||||
<Exec Command="dotnet run --project "$(MSBuildProjectDirectory)\..\AmalgamationTool\AmalgamationTool.csproj" -- "$(AmalgamationSourceDir)" "$(AmalgamationOutputFile)"" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -22,3 +22,4 @@ Full documentation is available in [`docs/README.md`](docs/README.md):
|
||||
- `DynamORM.Tests/`: test suite
|
||||
- `AmalgamationTool/`: amalgamation generator and generated single-file output
|
||||
- `DynamORM.Net40.csproj`: net40 build for amalgamated source compatibility
|
||||
- `scripts/docker/`: dockerized build, test, amalgamation generation, and mono net40 smoke scripts
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using DynamORM;
|
||||
using DynamORM.Helpers;
|
||||
using DynamORM.Mapper;
|
||||
using Tester.RealTests;
|
||||
|
||||
namespace Tester
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
private static DynamicDatabase GetORM()
|
||||
{
|
||||
return new DynamicDatabase(System.Data.SqlClient.SqlClientFactory.Instance,
|
||||
//"packet size=4096;User Id=sa;Password=sWe7PepR;data source=192.168.22.10;initial catalog=PLAYGROUND;",
|
||||
"packet size=4096;User Id=sa;Password=sWe7PepR;data source=192.168.22.10;initial catalog=MOM_DEMO_WMS_FILLED;",
|
||||
DynamicDatabaseOptions.SingleConnection | DynamicDatabaseOptions.SingleTransaction | DynamicDatabaseOptions.SupportSchema |
|
||||
DynamicDatabaseOptions.SupportStoredProcedures | DynamicDatabaseOptions.SupportTop | DynamicDatabaseOptions.DumpCommands |
|
||||
DynamicDatabaseOptions.SupportStoredProceduresResult);
|
||||
|
||||
////return new DynamORM.DynamicDatabase(System.Data.SQLite.SQLiteFactory.Instance,
|
||||
//// "Data Source=test.db3;",
|
||||
//// DynamORM.DynamicDatabaseOptions.SingleConnection | DynamORM.DynamicDatabaseOptions.SingleTransaction |
|
||||
//// DynamORM.DynamicDatabaseOptions.SupportSchema | DynamORM.DynamicDatabaseOptions.SupportLimitOffset);
|
||||
///
|
||||
}
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
|
||||
using (var db = GetORM())
|
||||
{
|
||||
var num = db.Procedures.usp_NewNumber(counterName: "TRAY");
|
||||
|
||||
//ProcedureHell(db);
|
||||
//OddNullabeleProblem.Test(db);
|
||||
|
||||
//TableFun(db);
|
||||
}
|
||||
}
|
||||
|
||||
private static void TableFun(DynamicDatabase db)
|
||||
{
|
||||
try
|
||||
{
|
||||
db.Execute("DROP TABLE Experiments ");
|
||||
}
|
||||
catch { }
|
||||
|
||||
db.Execute(@"CREATE TABLE Experiments (
|
||||
id int NOT NULL PRIMARY KEY,
|
||||
t1 nvarchar(50) NOT NULL DEFAULT N'',
|
||||
t2 varchar(50) NOT NULL DEFAULT '',
|
||||
dd date,
|
||||
tt time);");
|
||||
|
||||
db.Insert<Ex>().Insert(new Ex
|
||||
{
|
||||
id = 1,
|
||||
t1 = "T1",
|
||||
t2 = "T1",
|
||||
dd = DateTime.Now,
|
||||
tt = TimeSpan.FromDays(2) + TimeSpan.FromHours(10),
|
||||
}).Execute();
|
||||
|
||||
var tt = db.From<Ex>().Where(x => x.id == 1).ToList<Ex>().FirstOrDefault();
|
||||
|
||||
db.Update<Ex>().Where(x => x.id == 1).Set(x => x.tt = TimeSpan.FromMinutes(10), x => x.dd = DateTime.Now.AddDays(2)).Execute();
|
||||
|
||||
db.Execute("DROP TABLE Experiments ");
|
||||
}
|
||||
|
||||
[Table(Name = "Experiments")]
|
||||
private class Ex
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string t1 { get; set; }
|
||||
public string t2 { get; set; }
|
||||
public DateTime dd { get; set; }
|
||||
public TimeSpan tt { get; set; }
|
||||
}
|
||||
|
||||
private static void ProcedureHell(DynamicDatabase db)
|
||||
{
|
||||
db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_Scalar AS SELECT 42;");
|
||||
var res0 = db.Procedures.sp_Exp_Scalar();
|
||||
var res1 = db.Procedures.sp_Exp_Scalar<int>();
|
||||
|
||||
db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_ReturnInt AS RETURN 42;");
|
||||
var res2 = db.Procedures.sp_Exp_ReturnInt();
|
||||
|
||||
db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_SomeData AS
|
||||
SELECT 1 Id, 'Some Name 1' [Name], 'Some Desc 1' [Desc], GETDATE() [Date]
|
||||
UNION ALL SELECT 2 Id, 'Some Name 2', 'Some Desc 2', GETDATE() [Date];");
|
||||
var res3 = db.Procedures.sp_Exp_SomeData<sp_Exp_SomeData_Result>();
|
||||
var res4 = db.Procedures.sp_Exp_SomeData<List<sp_Exp_SomeData_Result>>();
|
||||
|
||||
db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_SomeInputAndOutput
|
||||
@Name nvarchar(50),
|
||||
@Result nvarchar(256) OUTPUT
|
||||
AS
|
||||
SELECT @Result = 'Hi, ' + @Name + ' your lucky number is 42!';");
|
||||
var res5 = db.Procedures.sp_Exp_SomeInputAndOutput<string, sp_Exp_SomeInputAndOutput_Result>(Name: "G4g4r1n", out_Result: new DynamicColumn
|
||||
{
|
||||
Schema = new DynamicSchemaColumn
|
||||
{
|
||||
Size = 256,
|
||||
},
|
||||
}, ret_Return: 0);
|
||||
var res6 = db.Procedures.sp_Exp_SomeInputAndOutput<string, sp_Exp_SomeInputAndOutput_Result>(Name: "G4g4r1n", out_Result: new DynamicSchemaColumn
|
||||
{
|
||||
Size = 256,
|
||||
}, ret_Return: 0);
|
||||
|
||||
db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_SomeInputAndOutputWithDataAndReturn
|
||||
@Name nvarchar(50),
|
||||
@Result nvarchar(256) OUTPUT
|
||||
AS
|
||||
SELECT @Result = 'Hi, ' + @Name + ' your lucky number is 42!'
|
||||
|
||||
SELECT 1 Id, 'Some Name 1' [Name], 'Some Desc 1' [Desc], GETDATE() [Date]
|
||||
UNION ALL SELECT 2 Id, 'Some Name 2', 'Some Desc 2', GETDATE() [Date]
|
||||
|
||||
RETURN 42;");
|
||||
var res7 = db.Procedures.sp_Exp_SomeInputAndOutputWithDataAndReturn<List<sp_Exp_SomeInputAndOutputWithDataAndReturn_Result.Data>, sp_Exp_SomeInputAndOutputWithDataAndReturn_Result>(Name: "G4g4r1n", out_Result: new DynamicColumn
|
||||
{
|
||||
Schema = new DynamicSchemaColumn
|
||||
{
|
||||
Size = 256,
|
||||
},
|
||||
}, ret_Return: 0);
|
||||
var res8 = db.Procedures.sp_Exp_SomeInputAndOutputWithDataAndReturn<List<sp_Exp_SomeInputAndOutputWithDataAndReturn_Result.Data>, sp_Exp_SomeInputAndOutputWithDataAndReturn_Result>(Name: "G4g4r1n", out_Result: new DynamicSchemaColumn
|
||||
{
|
||||
Size = 256,
|
||||
}, ret_Return: 0);
|
||||
}
|
||||
|
||||
private class sp_Exp_SomeData_Result
|
||||
{
|
||||
public virtual int Id { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string Desc { get; set; }
|
||||
public virtual DateTime Date { get; set; }
|
||||
}
|
||||
|
||||
private class sp_Exp_SomeInputAndOutput_Result
|
||||
{
|
||||
public virtual string Result { get; set; }
|
||||
public virtual string Return { get; set; }
|
||||
}
|
||||
|
||||
private class sp_Exp_SomeInputAndOutputWithDataAndReturn_Result
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
public virtual int Id { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string Desc { get; set; }
|
||||
public virtual DateTime Date { get; set; }
|
||||
}
|
||||
|
||||
public virtual List<Data> sp_Exp_SomeInputAndOutputWithDataAndReturn { get; set; }
|
||||
public virtual string Result { get; set; }
|
||||
public virtual string Return { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,448 +0,0 @@
|
||||
using DynamORM;
|
||||
using DynamORM.Mapper;
|
||||
using DynamORM.Objects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Tester.RealTests
|
||||
{
|
||||
internal static class OddNullabeleProblem
|
||||
{
|
||||
public static void Test(DynamicDatabase db)
|
||||
{
|
||||
var ca = new mom_Contractors_Articles();
|
||||
ca.mca_min_date_valid_out = 5;
|
||||
ca.mca_mar_code = "342";
|
||||
ca.mca_mar_name = "234";
|
||||
ca.SetDynamicEntityState(DynamicEntityState.Existing);
|
||||
ca.mca_min_date_valid_out = null;
|
||||
ca.mca_mar_code = null;
|
||||
ca.mca_mar_name = null;
|
||||
|
||||
var r = new DynamicRepositoryBase<mom_Contractors_Articles>(db);
|
||||
r.Save(ca);
|
||||
}
|
||||
|
||||
[Table(Name = "mom_Contractors_Articles")]
|
||||
public class mom_Contractors_Articles : DynamicEntityBase
|
||||
{
|
||||
private System.Guid _mca_id;
|
||||
|
||||
[Column("mca_id", true, AllowNull = false)]
|
||||
public virtual System.Guid mca_id
|
||||
{
|
||||
get { return _mca_id; }
|
||||
set
|
||||
{
|
||||
if (_mca_id != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_id", _mca_id, value);
|
||||
_mca_id = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Guid> _mca_mc_id;
|
||||
|
||||
[Column("mca_mc_id")]
|
||||
public virtual System.Nullable<System.Guid> mca_mc_id
|
||||
{
|
||||
get { return _mca_mc_id; }
|
||||
set
|
||||
{
|
||||
if (_mca_mc_id != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_mc_id", _mca_mc_id, value);
|
||||
_mca_mc_id = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Guid> _mca_mar_id;
|
||||
|
||||
[Column("mca_mar_id")]
|
||||
public virtual System.Nullable<System.Guid> mca_mar_id
|
||||
{
|
||||
get { return _mca_mar_id; }
|
||||
set
|
||||
{
|
||||
if (_mca_mar_id != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_mar_id", _mca_mar_id, value);
|
||||
_mca_mar_id = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Int32> _mca_min_date_valid_out;
|
||||
|
||||
[Column("mca_min_date_valid_out", AllowNull = true)]
|
||||
public virtual System.Nullable<System.Int32> mca_min_date_valid_out
|
||||
{
|
||||
get { return _mca_min_date_valid_out; }
|
||||
set
|
||||
{
|
||||
if (_mca_min_date_valid_out != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_min_date_valid_out", _mca_min_date_valid_out, value);
|
||||
_mca_min_date_valid_out = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Int32> _mca_min_date_valid_in;
|
||||
|
||||
[Column("mca_min_date_valid_in")]
|
||||
public virtual System.Nullable<System.Int32> mca_min_date_valid_in
|
||||
{
|
||||
get { return _mca_min_date_valid_in; }
|
||||
set
|
||||
{
|
||||
if (_mca_min_date_valid_in != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_min_date_valid_in", _mca_min_date_valid_in, value);
|
||||
_mca_min_date_valid_in = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.String _mca_mar_code;
|
||||
|
||||
[Column("mca_mar_code", AllowNull = true)]
|
||||
public virtual System.String mca_mar_code
|
||||
{
|
||||
get { return _mca_mar_code; }
|
||||
set
|
||||
{
|
||||
if (_mca_mar_code != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_mar_code", _mca_mar_code, value);
|
||||
_mca_mar_code = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.String _mca_mar_name;
|
||||
|
||||
[Column("mca_mar_name", AllowNull = true)]
|
||||
public virtual System.String mca_mar_name
|
||||
{
|
||||
get { return _mca_mar_name; }
|
||||
set
|
||||
{
|
||||
if (_mca_mar_name != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_mar_name", _mca_mar_name, value);
|
||||
_mca_mar_name = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.String _mca_gid;
|
||||
|
||||
[Column("mca_GID")]
|
||||
public virtual System.String mca_GID
|
||||
{
|
||||
get { return _mca_gid; }
|
||||
set
|
||||
{
|
||||
if (_mca_gid != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_GID", _mca_gid, value);
|
||||
_mca_gid = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Decimal> _mca_percent_wz;
|
||||
|
||||
[Column("mca_percent_WZ")]
|
||||
public virtual System.Nullable<System.Decimal> mca_percent_WZ
|
||||
{
|
||||
get { return _mca_percent_wz; }
|
||||
set
|
||||
{
|
||||
if (_mca_percent_wz != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_percent_WZ", _mca_percent_wz, value);
|
||||
_mca_percent_wz = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Decimal> _mca_percent_pz;
|
||||
|
||||
[Column("mca_percent_PZ")]
|
||||
public virtual System.Nullable<System.Decimal> mca_percent_PZ
|
||||
{
|
||||
get { return _mca_percent_pz; }
|
||||
set
|
||||
{
|
||||
if (_mca_percent_pz != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_percent_PZ", _mca_percent_pz, value);
|
||||
_mca_percent_pz = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Byte _mca_tss_ignore;
|
||||
|
||||
[Column("mca_tss_ignore", AllowNull = false)]
|
||||
public virtual System.Byte mca_tss_ignore
|
||||
{
|
||||
get { return _mca_tss_ignore; }
|
||||
set
|
||||
{
|
||||
if (_mca_tss_ignore != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_tss_ignore", _mca_tss_ignore, value);
|
||||
_mca_tss_ignore = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.String _mca_mar_bar_code;
|
||||
|
||||
[Column("mca_mar_bar_code")]
|
||||
public virtual System.String mca_mar_bar_code
|
||||
{
|
||||
get { return _mca_mar_bar_code; }
|
||||
set
|
||||
{
|
||||
if (_mca_mar_bar_code != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_mar_bar_code", _mca_mar_bar_code, value);
|
||||
_mca_mar_bar_code = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Guid> _mca_mus_id_modified;
|
||||
|
||||
[Column("mca_mus_id_modified")]
|
||||
public virtual System.Nullable<System.Guid> mca_mus_id_modified
|
||||
{
|
||||
get { return _mca_mus_id_modified; }
|
||||
set
|
||||
{
|
||||
if (_mca_mus_id_modified != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_mus_id_modified", _mca_mus_id_modified, value);
|
||||
_mca_mus_id_modified = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.DateTime> _mca_date_modified;
|
||||
|
||||
[Column("mca_date_modified")]
|
||||
public virtual System.Nullable<System.DateTime> mca_date_modified
|
||||
{
|
||||
get { return _mca_date_modified; }
|
||||
set
|
||||
{
|
||||
if (_mca_date_modified != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_date_modified", _mca_date_modified, value);
|
||||
_mca_date_modified = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.String _mca_ean_label_unit;
|
||||
|
||||
[Column("mca_ean_label_unit")]
|
||||
public virtual System.String mca_ean_label_unit
|
||||
{
|
||||
get { return _mca_ean_label_unit; }
|
||||
set
|
||||
{
|
||||
if (_mca_ean_label_unit != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_ean_label_unit", _mca_ean_label_unit, value);
|
||||
_mca_ean_label_unit = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.String _mca_ean_label_pckg;
|
||||
|
||||
[Column("mca_ean_label_pckg")]
|
||||
public virtual System.String mca_ean_label_pckg
|
||||
{
|
||||
get { return _mca_ean_label_pckg; }
|
||||
set
|
||||
{
|
||||
if (_mca_ean_label_pckg != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_ean_label_pckg", _mca_ean_label_pckg, value);
|
||||
_mca_ean_label_pckg = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Decimal> _mca_price;
|
||||
|
||||
[Column("mca_price")]
|
||||
public virtual System.Nullable<System.Decimal> mca_price
|
||||
{
|
||||
get { return _mca_price; }
|
||||
set
|
||||
{
|
||||
if (_mca_price != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_price", _mca_price, value);
|
||||
_mca_price = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.String _mca_currency_code;
|
||||
|
||||
[Column("mca_currency_code")]
|
||||
public virtual System.String mca_currency_code
|
||||
{
|
||||
get { return _mca_currency_code; }
|
||||
set
|
||||
{
|
||||
if (_mca_currency_code != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_currency_code", _mca_currency_code, value);
|
||||
_mca_currency_code = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Int32> _mca_time_ahead;
|
||||
|
||||
[Column("mca_time_ahead")]
|
||||
public virtual System.Nullable<System.Int32> mca_time_ahead
|
||||
{
|
||||
get { return _mca_time_ahead; }
|
||||
set
|
||||
{
|
||||
if (_mca_time_ahead != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_time_ahead", _mca_time_ahead, value);
|
||||
_mca_time_ahead = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Decimal> _mca_last_price;
|
||||
|
||||
[Column("mca_last_price")]
|
||||
public virtual System.Nullable<System.Decimal> mca_last_price
|
||||
{
|
||||
get { return _mca_last_price; }
|
||||
set
|
||||
{
|
||||
if (_mca_last_price != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_last_price", _mca_last_price, value);
|
||||
_mca_last_price = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Decimal> _mca_logistic_minimum_value;
|
||||
|
||||
[Column("mca_logistic_minimum_value")]
|
||||
public virtual System.Nullable<System.Decimal> mca_logistic_minimum_value
|
||||
{
|
||||
get { return _mca_logistic_minimum_value; }
|
||||
set
|
||||
{
|
||||
if (_mca_logistic_minimum_value != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_logistic_minimum_value", _mca_logistic_minimum_value, value);
|
||||
_mca_logistic_minimum_value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Decimal> _mca_logistic_minimum_mplt;
|
||||
|
||||
[Column("mca_logistic_minimum_mplt")]
|
||||
public virtual System.Nullable<System.Decimal> mca_logistic_minimum_mplt
|
||||
{
|
||||
get { return _mca_logistic_minimum_mplt; }
|
||||
set
|
||||
{
|
||||
if (_mca_logistic_minimum_mplt != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_logistic_minimum_mplt", _mca_logistic_minimum_mplt, value);
|
||||
_mca_logistic_minimum_mplt = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Decimal> _mca_logistic_minimum_qty;
|
||||
|
||||
[Column("mca_logistic_minimum_qty")]
|
||||
public virtual System.Nullable<System.Decimal> mca_logistic_minimum_qty
|
||||
{
|
||||
get { return _mca_logistic_minimum_qty; }
|
||||
set
|
||||
{
|
||||
if (_mca_logistic_minimum_qty != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_logistic_minimum_qty", _mca_logistic_minimum_qty, value);
|
||||
_mca_logistic_minimum_qty = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Decimal> _mca_req_kj_percent;
|
||||
|
||||
[Column("mca_req_kj_percent")]
|
||||
public virtual System.Nullable<System.Decimal> mca_req_kj_percent
|
||||
{
|
||||
get { return _mca_req_kj_percent; }
|
||||
set
|
||||
{
|
||||
if (_mca_req_kj_percent != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_req_kj_percent", _mca_req_kj_percent, value);
|
||||
_mca_req_kj_percent = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Nullable<System.Decimal> _mca_min_order_qty;
|
||||
|
||||
[Column("mca_min_order_qty")]
|
||||
public virtual System.Nullable<System.Decimal> mca_min_order_qty
|
||||
{
|
||||
get { return _mca_min_order_qty; }
|
||||
set
|
||||
{
|
||||
if (_mca_min_order_qty != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_min_order_qty", _mca_min_order_qty, value);
|
||||
_mca_min_order_qty = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Byte _mca_default_contractor;
|
||||
|
||||
[Column("mca_default_contractor", AllowNull = false)]
|
||||
public virtual System.Byte mca_default_contractor
|
||||
{
|
||||
get { return _mca_default_contractor; }
|
||||
set
|
||||
{
|
||||
if (_mca_default_contractor != value)
|
||||
{
|
||||
this.OnPropertyChanging("mca_default_contractor", _mca_default_contractor, value);
|
||||
_mca_default_contractor = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<Copyright>Copyright © RUSSEK Software 2012-2022</Copyright>
|
||||
<Company>RUSSEK Software</Company>
|
||||
<Authors>Grzegorz Russek</Authors>
|
||||
<VersionPrefix>1.2.1</VersionPrefix>
|
||||
<RepositoryUrl>https://svn.dr4cul4.pl/svn/DynamORM/</RepositoryUrl>
|
||||
<PackageProjectUrl>https://dr4cul4.pl</PackageProjectUrl>
|
||||
<Product>DynamORM</Product>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
<PackageReference Include="System.Data.Common" Version="4.3.0" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(MSBuildRuntimeType)' == 'Core' AND '$(OS)' != 'Windows_NT'">
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DynamORM\DynamORM.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
19
scripts/docker/build-and-test.sh
Executable file
19
scripts/docker/build-and-test.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
IMAGE="${DOTNET_IMAGE:-mcr.microsoft.com/dotnet/sdk:10.0}"
|
||||
|
||||
docker run --rm \
|
||||
-v "${ROOT_DIR}:/workspace" \
|
||||
-w /workspace \
|
||||
"${IMAGE}" \
|
||||
bash -lc "
|
||||
set -euo pipefail
|
||||
dotnet --info
|
||||
dotnet restore DynamORM.sln
|
||||
dotnet build DynamORM.sln -c Release --no-restore
|
||||
dotnet test DynamORM.Tests/DynamORM.Tests.csproj -c Release --no-build
|
||||
dotnet pack DynamORM/DynamORM.csproj -c Release --no-build -o /workspace/artifacts/nuget
|
||||
"
|
||||
|
||||
11
scripts/docker/ci-local.sh
Executable file
11
scripts/docker/ci-local.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
|
||||
"${ROOT_DIR}/scripts/docker/generate-amalgamation.sh"
|
||||
"${ROOT_DIR}/scripts/docker/build-and-test.sh"
|
||||
"${ROOT_DIR}/scripts/docker/mono-net40-smoke.sh"
|
||||
|
||||
echo "All docker checks completed."
|
||||
|
||||
15
scripts/docker/generate-amalgamation.sh
Executable file
15
scripts/docker/generate-amalgamation.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
IMAGE="${DOTNET_IMAGE:-mcr.microsoft.com/dotnet/sdk:10.0}"
|
||||
|
||||
docker run --rm \
|
||||
-v "${ROOT_DIR}:/workspace" \
|
||||
-w /workspace \
|
||||
"${IMAGE}" \
|
||||
bash -lc "
|
||||
set -euo pipefail
|
||||
dotnet run --project AmalgamationTool/AmalgamationTool.csproj -- DynamORM AmalgamationTool/DynamORM.Amalgamation.cs
|
||||
"
|
||||
|
||||
23
scripts/docker/mono-net40-smoke.sh
Executable file
23
scripts/docker/mono-net40-smoke.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
IMAGE="${MONO_IMAGE:-mono:6.12}"
|
||||
|
||||
docker run --rm \
|
||||
-v "${ROOT_DIR}:/workspace" \
|
||||
-w /workspace \
|
||||
"${IMAGE}" \
|
||||
bash -lc "
|
||||
set -euo pipefail
|
||||
mono --version
|
||||
mcs -langversion:latest -target:library -sdk:4 \
|
||||
-r:System \
|
||||
-r:System.Core \
|
||||
-r:System.Data \
|
||||
-r:Microsoft.CSharp \
|
||||
-out:/tmp/DynamORM.Net40.Smoke.dll \
|
||||
AmalgamationTool/DynamORM.Amalgamation.cs
|
||||
ls -lh /tmp/DynamORM.Net40.Smoke.dll
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user