Permalink
Browse files

C# driver v1.3.1.

  • Loading branch information...
1 parent f531df2 commit f7b55b5dbca66bc07e7dc8f6b0029ce6a78da17c @nightroman committed Nov 30, 2011
Showing with 23 additions and 16 deletions.
  1. +3 −0 .build.ps1
  2. +4 −0 Release-Notes.md
  3. +1 −1 Src/AssemblyInfo.cs
  4. +14 −14 Tests/Test-MongoFiles.ps1
  5. +1 −1 Tests/Test-Query.ps1
View
@@ -193,6 +193,9 @@ operations on MongoDB data.
exec { NuGet pack z\Package.nuspec }
}
+# Make both packages.
+task Pack Zip, NuGet
+
# Check files on commit. Called by .git/hooks/pre-commit.
task pre-commit {
$Pattern = '\.(cs|csproj|md|ps1|psd1|psm1|ps1xml|sln|txt|xml|gitignore)$'
View
@@ -1,6 +1,10 @@
Mdbc Release Notes
==================
+## v1.0.2
+
+C# driver v1.3.1.
+
## v1.0.1
C# driver v1.3.
View
@@ -4,7 +4,7 @@
using System;
[assembly: AssemblyProduct("Mdbc")]
-[assembly: AssemblyVersion("1.0.1")]
+[assembly: AssemblyVersion("1.0.2")]
[assembly: AssemblyTitle("Mdbc module - MongoDB Cmdlets for PowerShell")]
[assembly: AssemblyCompany("https://github.com/nightroman/Mdbc")]
[assembly: AssemblyCopyright("Copyright (c) 2011 Roman Kuzmin")]
@@ -11,56 +11,56 @@ Import-Module Mdbc
$collection = Connect-Mdbc . test files
function Test-Query($query) {
- Write-Host $query.ToString()
+ Write-Verbose -Verbose $query.ToString()
$watch = [System.Diagnostics.Stopwatch]::StartNew()
$count = Get-MdbcData -Count $collection $query
- Write-Host "$count for $($watch.Elapsed)"
+ Write-Verbose -Verbose "$count for $($watch.Elapsed)"
$count
}
$total = $collection.Count()
-Write-Host "$total documents"
+"$total documents"
-Write-Host "EQ NE"
+"EQ NE"
$EQReadme = Test-Query (query Name Readme.txt)
$NEReadme = Test-Query (query Name -NE Readme.txt)
-if ($total -ne $EQReadme + $NEReadme) { throw }
+if ($total -ne $EQReadme + $NEReadme) { throw "$total -ne $EQReadme + $NEReadme" }
-Write-Host "IEQ INE"
+"IEQ INE"
$n1 = Test-Query (query Name -IEQ README.TXT)
if ($n1 -lt $EQReadme) { throw }
$n2 = Test-Query (query Name -INE README.TXT)
if ($n2 -ne $total - $n1) { throw }
-Write-Host "EQ GT LT"
+"EQ GT LT"
$n1 = Test-Query (query LastWriteTime $time1)
$n2 = Test-Query (query LastWriteTime -GT $time1)
$n3 = Test-Query (query LastWriteTime -LT $time1)
if ($total -ne $n1 + $n2 + $n3) { throw }
-Write-Host "GE LE"
+"GE LE"
$n2 = Test-Query (query LastWriteTime -GE $time1)
$n3 = Test-Query (query LastWriteTime -LE $time1)
if ($total -ne -$n1 + $n2 + $n3) { throw }
-Write-Host "And"
+"And"
$n1 = Test-Query (query (query Name Readme.txt), (query LastWriteTime -GT $time1))
$n2 = Test-Query (query (query Name Readme.txt), (query LastWriteTime -LT $time1))
if ($EQReadme -ne $n1 + $n2) { throw }
-Write-Host "Or In Match"
+"Or In Match"
$n1 = Test-Query (query -Or (query Name Readme.txt), (query Name About.txt), (query Name LICENSE))
$n2 = Test-Query (query Name -In Readme.txt, About.txt, LICENSE)
if ($n1 -ne $n2) { throw }
$n2 = Test-Query (query Name -Match '^(?:Readme\.txt|About\.txt|LICENSE)$')
if ($n1 -ne $n2) { throw }
-Write-Host "Match, ignore case"
+"Match, ignore case"
$n1 = Test-Query (query Name -Match '^(?i:Readme\.txt|About\.txt|LICENSE)$')
$n2 = Test-Query (query Name -Match (New-Object regex '^(?:Readme\.txt|About\.txt|LICENSE)$', IgnoreCase))
if ($n1 -ne $n2) { throw }
-Write-Host "Exists Mod Not"
+"Exists Mod Not"
$MissingLength = Test-Query (query Length -Exists $false)
$n1 = Test-Query (query Length -Mod 2, 0)
$n2 = Test-Query (query Length -Not -Mod 2, 1)
@@ -69,12 +69,12 @@ $n1 = Test-Query (query Length -Mod 2, 1)
$n2 = Test-Query (query Length -Not -Mod 2, 0)
if ($MissingLength + $n1 -ne $n2) { throw }
-Write-Host "Type"
+"Type"
$n1 = Test-Query (query Length -Type Int64)
if ($n1 -ne $total - $MissingLength) { throw }
if (0) {
- Write-Host "Where (VERY SLOW!)"
+ "Where (VERY SLOW!)"
$n1 = Test-Query (query -Where 'this.Length == null')
if ($n1 -ne $MissingLength) { throw }
}
@@ -8,7 +8,7 @@ Import-Module Mdbc
# Test: compare the expression with expected representation
function test([Parameter()]$value, $expected) {
- Write-Host "$value => $expected"
+ "$value => $expected"
$actual = (. $value).ToString()
if ($actual -cne $expected) {
$PSCmdlet.ThrowTerminatingError((New-Object System.Management.Automation.ErrorRecord ([Exception]"Actual:`n$actual"), $null, 'InvalidResult', $value))

0 comments on commit f7b55b5

Please sign in to comment.