You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by sy...@apache.org on 2014/09/06 21:36:21 UTC
[10/51] [abbrv] [partial] Cleaning up and getting ready to
development towards v4.8
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/SimpleVBTest.vb
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/SimpleVBTest.vb b/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/SimpleVBTest.vb
deleted file mode 100644
index 14b49a2..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/SimpleVBTest.vb
+++ /dev/null
@@ -1,60 +0,0 @@
-' ****************************************************************
-' This is free software licensed under the NUnit license. You
-' may obtain a copy of the license as well as information regarding
-' copyright ownership at http://nunit.org/?p=license&r=2.4.
-' ****************************************************************
-
-Option Explicit On
-Imports System
-Imports NUnit.Framework
-
-Namespace NUnit.Samples
-
- <TestFixture()> Public Class SimpleVBTest
-
- Private fValue1 As Integer
- Private fValue2 As Integer
-
- Public Sub New()
- MyBase.New()
- End Sub
-
- <SetUp()> Public Sub Init()
- fValue1 = 2
- fValue2 = 3
- End Sub
-
- <Test()> Public Sub Add()
- Dim result As Double
-
- result = fValue1 + fValue2
- Assert.AreEqual(6, result)
- End Sub
-
- <Test()> Public Sub DivideByZero()
- Dim zero As Integer
- Dim result As Integer
-
- zero = 0
- result = 8 / zero
- End Sub
-
- <Test()> Public Sub TestEquals()
- Assert.AreEqual(12, 12)
- Assert.AreEqual(CLng(12), CLng(12))
-
- Assert.AreEqual(12, 13, "Size")
- Assert.AreEqual(12, 11.99, 0, "Capacity")
- End Sub
-
- <Test(), ExpectedException(GetType(Exception))> Public Sub ExpectAnException()
- Throw New InvalidCastException()
- End Sub
-
- <Test(), Ignore("sample ignore")> Public Sub IgnoredTest()
- ' does not matter what we type the test is not run
- Throw New ArgumentException()
- End Sub
-
- End Class
-End Namespace
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/vb-failures.build
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/vb-failures.build b/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/vb-failures.build
deleted file mode 100644
index 1d89264..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/vb-failures.build
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<project name="vb-failures" default="build">
-
- <include buildfile="../../samples.common" />
-
- <patternset id="source-files">
- <include name="AssemblyInfo.vb" />
- <include name="SimpleVBTest.vb" />
- </patternset>
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/vb-failures.vbproj
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/vb-failures.vbproj b/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/vb-failures.vbproj
deleted file mode 100644
index 4eff16b..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/failures/vb-failures.vbproj
+++ /dev/null
@@ -1,24 +0,0 @@
-<VisualStudioProject>
- <VisualBasic ProjectType="Local" ProductVersion="7.10.3077" SchemaVersion="2.0" ProjectGuid="{F199991B-6C8E-4AB0-9AAA-703CD4897700}">
- <Build>
- <Settings ApplicationIcon="" AssemblyKeyContainerName="" AssemblyName="vb-failures" AssemblyOriginatorKeyFile="" AssemblyOriginatorKeyMode="None" DefaultClientScript="JScript" DefaultHTMLPageLayout="Grid" DefaultTargetSchema="IE50" DelaySign="false" OutputType="Library" OptionCompare="Binary" OptionExplicit="On" OptionStrict="Off" RootNamespace="vb_failures" StartupObject="vb_failures.(None)">
- <Config Name="Debug" BaseAddress="285212672" ConfigurationOverrideFile="" DefineConstants="" DefineDebug="true" DefineTrace="true" DebugSymbols="true" IncrementalBuild="true" Optimize="false" OutputPath="bin\" RegisterForComInterop="false" RemoveIntegerChecks="false" TreatWarningsAsErrors="false" WarningLevel="1" />
- <Config Name="Release" BaseAddress="285212672" ConfigurationOverrideFile="" DefineConstants="" DefineDebug="false" DefineTrace="true" DebugSymbols="false" IncrementalBuild="false" Optimize="true" OutputPath="bin\" RegisterForComInterop="false" RemoveIntegerChecks="false" TreatWarningsAsErrors="false" WarningLevel="1" />
- </Settings>
- <References>
- <Reference Name="System" AssemblyName="System" />
- <Reference Name="nunit.framework" AssemblyName="nunit.framework, Version=2.5, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" HintPath="..\..\..\bin\net-1.1\framework\nunit.framework.dll" />
- </References>
- <Imports>
- <Import Namespace="Microsoft.VisualBasic" />
- <Import Namespace="System" />
- </Imports>
- </Build>
- <Files>
- <Include>
- <File RelPath="AssemblyInfo.vb" SubType="Code" BuildAction="Compile" />
- <File RelPath="SimpleVBTest.vb" SubType="Code" BuildAction="Compile" />
- </Include>
- </Files>
- </VisualBasic>
-</VisualStudioProject>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/AssemblyInfo.vb
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/AssemblyInfo.vb b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/AssemblyInfo.vb
deleted file mode 100644
index f929cbc..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/AssemblyInfo.vb
+++ /dev/null
@@ -1,32 +0,0 @@
-Imports System
-Imports System.Reflection
-Imports 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.
-
-' Review the values of the assembly attributes
-
-<Assembly: AssemblyTitle("")>
-<Assembly: AssemblyDescription("")>
-<Assembly: AssemblyCompany("")>
-<Assembly: AssemblyProduct("")>
-<Assembly: AssemblyCopyright("")>
-<Assembly: AssemblyTrademark("")>
-<Assembly: CLSCompliant(True)>
-
-'The following GUID is for the ID of the typelib if this project is exposed to COM
-<Assembly: Guid("F21BB3B6-0C5E-4AE5-ABC7-4D25FC3F98DB")>
-
-' 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.*")>
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/IMoney.vb
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/IMoney.vb b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/IMoney.vb
deleted file mode 100644
index ddc8ae6..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/IMoney.vb
+++ /dev/null
@@ -1,37 +0,0 @@
-' ****************************************************************
-' This is free software licensed under the NUnit license. You
-' may obtain a copy of the license as well as information regarding
-' copyright ownership at http://nunit.org/?p=license&r=2.4.
-' ****************************************************************
-
-Namespace NUnit.Samples
-
- 'The common interface for simple Monies and MoneyBags.
- Public Interface IMoney
-
- 'Adds a money to this money
- Function Add(ByVal m As IMoney) As IMoney
-
- 'Adds a simple Money to this money. This is a helper method for
- 'implementing double dispatch.
- Function AddMoney(ByVal m As Money) As IMoney
-
- 'Adds a MoneyBag to this money. This is a helper method for
- 'implementing double dispatch.
- Function AddMoneyBag(ByVal s As MoneyBag) As IMoney
-
- 'True if this money is zero.
- ReadOnly Property IsZero() As Boolean
-
- 'Multiplies a money by the given factor.
- Function Multiply(ByVal factor As Int32) As IMoney
-
- 'Negates this money.
- Function Negate() As IMoney
-
- 'Subtracts a money from this money.
- Function Subtract(ByVal m As IMoney) As IMoney
-
- End Interface
-
-End Namespace
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/Money.vb
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/Money.vb b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/Money.vb
deleted file mode 100644
index f7699a8..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/Money.vb
+++ /dev/null
@@ -1,109 +0,0 @@
-' ****************************************************************
-' This is free software licensed under the NUnit license. You
-' may obtain a copy of the license as well as information regarding
-' copyright ownership at http://nunit.org/?p=license&r=2.4.
-' ****************************************************************
-
-Option Explicit On
-
-Namespace NUnit.Samples
-
- ' A Simple Money.
- Public Class Money
- Implements IMoney
-
- Private fAmount As Int32
- Private fCurrency As String
-
- ' Constructs a money from a given amount and currency.
- Public Sub New(ByVal amount As Int32, ByVal currency As String)
- Me.fAmount = amount
- Me.fCurrency = currency
- End Sub
-
-
- ' Adds a money to this money. Forwards the request
- ' to the AddMoney helper.
- Public Overloads Function Add(ByVal m As IMoney) As IMoney Implements IMoney.Add
- Return m.AddMoney(Me)
- End Function
-
- Public Overloads Function AddMoney(ByVal m As Money) As IMoney Implements IMoney.AddMoney
- If m.Currency.Equals(Currency) Then
- Return New Money(Amount + m.Amount, Currency)
- End If
-
- Return New MoneyBag(Me, m)
- End Function
-
- Public Function AddMoneyBag(ByVal s As MoneyBag) As IMoney Implements IMoney.AddMoneyBag
- Return s.AddMoney(Me)
- End Function
-
- Public ReadOnly Property Amount() As Integer
- Get
- Return fAmount
- End Get
- End Property
-
- Public ReadOnly Property Currency() As String
- Get
- Return fCurrency
- End Get
- End Property
-
- Public Overloads Overrides Function Equals(ByVal anObject As Object) As Boolean
- If IsZero And TypeOf anObject Is IMoney Then
- Dim aMoney As IMoney = anObject
- Return aMoney.IsZero
- End If
-
- If TypeOf anObject Is Money Then
- Dim aMoney As Money = anObject
- If (IsZero) Then
- Return aMoney.IsZero
- End If
-
- Return Currency.Equals(aMoney.Currency) And Amount.Equals(aMoney.Amount)
- End If
-
- Return False
- End Function
-
- Public Overrides Function GetHashCode() As Int32
- Return fCurrency.GetHashCode() + fAmount
- End Function
-
- Public ReadOnly Property IsZero() As Boolean Implements IMoney.IsZero
- Get
- Return Amount.Equals(0)
- End Get
- End Property
-
- Public Function Multiply(ByVal factor As Integer) As IMoney Implements IMoney.Multiply
-
- Return New Money(Amount * factor, Currency)
-
- End Function
-
- Public Function Negate() As IMoney Implements IMoney.Negate
-
- Return New Money(-Amount, Currency)
-
- End Function
-
- Public Function Subtract(ByVal m As IMoney) As IMoney Implements IMoney.Subtract
-
- Return Add(m.Negate())
-
- End Function
-
- Public Overrides Function ToString() As String
-
- Return String.Format("[{0} {1}]", Amount, Currency)
-
- End Function
-
- End Class
-
-End Namespace
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/MoneyBag.vb
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/MoneyBag.vb b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/MoneyBag.vb
deleted file mode 100644
index 409c1a1..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/MoneyBag.vb
+++ /dev/null
@@ -1,164 +0,0 @@
-' ****************************************************************
-' This is free software licensed under the NUnit license. You
-' may obtain a copy of the license as well as information regarding
-' copyright ownership at http://nunit.org/?p=license&r=2.4.
-' ****************************************************************
-
-Option Explicit On
-
-Namespace NUnit.Samples
-
- Public Class MoneyBag
- Implements IMoney
-
- Private fmonies As ArrayList = New ArrayList(5)
-
- Private Sub New()
-
- End Sub
-
- Public Sub New(ByVal bag As Money())
- For Each m As Money In bag
- If Not m.IsZero Then
- AppendMoney(m)
- End If
- Next
- End Sub
-
- Public Sub New(ByVal m1 As Money, ByVal m2 As Money)
-
- AppendMoney(m1)
- AppendMoney(m2)
-
- End Sub
-
- Public Sub New(ByVal m As Money, ByVal bag As MoneyBag)
- AppendMoney(m)
- AppendBag(bag)
- End Sub
-
- Public Sub New(ByVal m1 As MoneyBag, ByVal m2 As MoneyBag)
- AppendBag(m1)
- AppendBag(m2)
- End Sub
-
- Public Function Add(ByVal m As IMoney) As IMoney Implements IMoney.Add
- Return m.AddMoneyBag(Me)
- End Function
-
- Public Function AddMoney(ByVal m As Money) As IMoney Implements IMoney.AddMoney
- Return New MoneyBag(m, Me).Simplify
- End Function
-
- Public Function AddMoneyBag(ByVal s As MoneyBag) As IMoney Implements IMoney.AddMoneyBag
- Return New MoneyBag(s, Me).Simplify()
- End Function
-
- Private Sub AppendBag(ByVal aBag As MoneyBag)
- For Each m As Money In aBag.fmonies
- AppendMoney(m)
- Next
- End Sub
-
- Private Sub AppendMoney(ByVal aMoney As Money)
-
- Dim old As Money = FindMoney(aMoney.Currency)
- If old Is Nothing Then
- fmonies.Add(aMoney)
- Return
- End If
- fmonies.Remove(old)
- Dim sum As IMoney = old.Add(aMoney)
- If (sum.IsZero) Then
- Return
- End If
- fmonies.Add(sum)
- End Sub
-
- Private Function Contains(ByVal aMoney As Money) As Boolean
- Dim m As Money = FindMoney(aMoney.Currency)
- Return m.Amount.Equals(aMoney.Amount)
- End Function
-
- Public Overloads Overrides Function Equals(ByVal anObject As Object) As Boolean
- If IsZero Then
- If TypeOf anObject Is IMoney Then
- Dim aMoney As IMoney = anObject
- Return aMoney.IsZero
- End If
- End If
-
- If TypeOf anObject Is MoneyBag Then
- Dim aMoneyBag As MoneyBag = anObject
- If Not aMoneyBag.fmonies.Count.Equals(fmonies.Count) Then
- Return False
- End If
-
- For Each m As Money In fmonies
- If Not aMoneyBag.Contains(m) Then
- Return False
- End If
-
- Return True
- Next
- End If
-
- Return False
- End Function
-
- Private Function FindMoney(ByVal currency As String) As Money
- For Each m As Money In fmonies
- If m.Currency.Equals(currency) Then
- Return m
- End If
- Next
-
- Return Nothing
- End Function
-
- Public Overrides Function GetHashCode() As Int32
- Dim hash As Int32 = 0
- For Each m As Money In fmonies
- hash += m.GetHashCode()
- Next
- Return hash
- End Function
-
- Public ReadOnly Property IsZero() As Boolean Implements IMoney.IsZero
- Get
- Return fmonies.Count.Equals(0)
- End Get
- End Property
-
- Public Function Multiply(ByVal factor As Integer) As IMoney Implements IMoney.Multiply
- Dim result As New MoneyBag
- If Not factor.Equals(0) Then
- For Each m As Money In fmonies
- result.AppendMoney(m.Multiply(factor))
- Next
- End If
- Return result
- End Function
-
- Public Function Negate() As IMoney Implements IMoney.Negate
- Dim result As New MoneyBag
- For Each m As Money In fmonies
- result.AppendMoney(m.Negate())
- Next
- Return result
- End Function
-
- Private Function Simplify() As IMoney
- If fmonies.Count.Equals(1) Then
- Return fmonies(0)
- End If
- Return Me
- End Function
-
-
- Public Function Subtract(ByVal m As IMoney) As IMoney Implements IMoney.Subtract
- Return Add(m.Negate())
- End Function
- End Class
-
-End Namespace
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/MoneyTest.vb
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/MoneyTest.vb b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/MoneyTest.vb
deleted file mode 100644
index acb2c42..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/MoneyTest.vb
+++ /dev/null
@@ -1,216 +0,0 @@
-' ****************************************************************
-' This is free software licensed under the NUnit license. You
-' may obtain a copy of the license as well as information regarding
-' copyright ownership at http://nunit.org/?p=license&r=2.4.
-' ****************************************************************
-
-Option Explicit On
-
-Imports System
-Imports NUnit.Framework
-
-Namespace NUnit.Samples
-
- <TestFixture()> _
- Public Class MoneyTest
-
- Private f12CHF As Money
- Private f14CHF As Money
- Private f7USD As Money
- Private f21USD As Money
-
- Private fMB1 As MoneyBag
- Private fMB2 As MoneyBag
-
- <SetUp()> _
- Protected Sub SetUp()
-
- f12CHF = New Money(12, "CHF")
- f14CHF = New Money(14, "CHF")
- f7USD = New Money(7, "USD")
- f21USD = New Money(21, "USD")
-
- fMB1 = New MoneyBag(f12CHF, f7USD)
- fMB2 = New MoneyBag(f14CHF, f21USD)
-
- End Sub
-
- <Test()> _
- Public Sub BagMultiply()
- ' {[12 CHF][7 USD]} *2 == {[24 CHF][14 USD]}
- Dim bag() As Money = New Money() {New Money(24, "CHF"), New Money(14, "USD")}
- Dim expected As New MoneyBag(bag)
- Assert.AreEqual(expected, fMB1.Multiply(2))
- Assert.AreEqual(fMB1, fMB1.Multiply(1))
- Assert.IsTrue(fMB1.Multiply(0).IsZero)
- End Sub
-
- <Test()> _
- Public Sub BagNegate()
- ' {[12 CHF][7 USD]} negate == {[-12 CHF][-7 USD]}
- Dim bag() As Money = New Money() {New Money(-12, "CHF"), New Money(-7, "USD")}
- Dim expected As New MoneyBag(bag)
- Assert.AreEqual(expected, fMB1.Negate())
- End Sub
-
- <Test()> _
- Public Sub BagSimpleAdd()
-
- ' {[12 CHF][7 USD]} + [14 CHF] == {[26 CHF][7 USD]}
- Dim bag() As Money = New Money() {New Money(26, "CHF"), New Money(7, "USD")}
- Dim expected As New MoneyBag(bag)
- Assert.AreEqual(expected, fMB1.Add(f14CHF))
-
- End Sub
-
- <Test()> _
- Public Sub BagSubtract()
- ' {[12 CHF][7 USD]} - {[14 CHF][21 USD] == {[-2 CHF][-14 USD]}
- Dim bag() As Money = New Money() {New Money(-2, "CHF"), New Money(-14, "USD")}
- Dim expected As New MoneyBag(bag)
- Assert.AreEqual(expected, fMB1.Subtract(fMB2))
- End Sub
-
- <Test()> _
- Public Sub BagSumAdd()
- ' {[12 CHF][7 USD]} + {[14 CHF][21 USD]} == {[26 CHF][28 USD]}
- Dim bag() As Money = New Money() {New Money(26, "CHF"), New Money(28, "USD")}
- Dim expected As New MoneyBag(bag)
- Assert.AreEqual(expected, fMB1.Add(fMB2))
- End Sub
-
- <Test()> _
- Public Sub IsZero()
- Assert.IsTrue(fMB1.Subtract(fMB1).IsZero)
-
- Dim bag() As Money = New Money() {New Money(0, "CHF"), New Money(0, "USD")}
- Assert.IsTrue(New MoneyBag(bag).IsZero)
- End Sub
-
- <Test()> _
- Public Sub MixedSimpleAdd()
- ' [12 CHF] + [7 USD] == {[12 CHF][7 USD]}
- Dim bag() As Money = New Money() {f12CHF, f7USD}
- Dim expected As New MoneyBag(bag)
- Assert.AreEqual(expected, f12CHF.Add(f7USD))
- End Sub
-
- <Test()> _
- Public Sub MoneyBagEquals()
- ' NOTE: Normally we use Assert.AreEqual to test whether two
- ' objects are equal. But here we are testing the MoneyBag.Equals()
- ' method itself, so using AreEqual would not serve the purpose.
- Assert.IsFalse(fMB1.Equals(Nothing))
-
- Assert.IsTrue(fMB1.Equals(fMB1))
- Dim equal As MoneyBag = New MoneyBag(New Money(12, "CHF"), New Money(7, "USD"))
- Assert.IsTrue(fMB1.Equals(equal))
- Assert.IsFalse(fMB1.Equals(f12CHF))
- Assert.IsFalse(f12CHF.Equals(fMB1))
- Assert.IsFalse(fMB1.Equals(fMB2))
- End Sub
-
- <Test()> _
- Public Sub MoneyBagHash()
- Dim equal As MoneyBag = New MoneyBag(New Money(12, "CHF"), New Money(7, "USD"))
- Assert.AreEqual(fMB1.GetHashCode(), equal.GetHashCode())
- End Sub
-
- <Test()> _
- Public Sub MoneyEquals()
- ' NOTE: Normally we use Assert.AreEqual to test whether two
- ' objects are equal. But here we are testing the MoneyBag.Equals()
- ' method itself, so using AreEqual would not serve the purpose.
- Assert.IsFalse(f12CHF.Equals(Nothing))
- Dim equalMoney As Money = New Money(12, "CHF")
- Assert.IsTrue(f12CHF.Equals(f12CHF))
- Assert.IsTrue(f12CHF.Equals(equalMoney))
- Assert.IsFalse(f12CHF.Equals(f14CHF))
- End Sub
-
- <Test()> _
- Public Sub MoneyHash()
- Assert.IsFalse(f12CHF.Equals(Nothing))
- Dim equal As Money = New Money(12, "CHF")
- Assert.AreEqual(f12CHF.GetHashCode(), equal.GetHashCode())
- End Sub
-
- <Test()> _
- Public Sub Normalize()
- Dim bag() As Money = New Money() {New Money(26, "CHF"), New Money(28, "CHF"), New Money(6, "CHF")}
- Dim moneyBag As New MoneyBag(bag)
- Dim expected() As Money = New Money() {New Money(60, "CHF")}
- ' // note: expected is still a MoneyBag
- Dim expectedBag As New MoneyBag(expected)
- Assert.AreEqual(expectedBag, moneyBag)
- End Sub
-
- <Test()> _
- Public Sub Normalize2()
- ' {[12 CHF][7 USD]} - [12 CHF] == [7 USD]
- Dim expected As Money = New Money(7, "USD")
- Assert.AreEqual(expected, fMB1.Subtract(f12CHF))
- End Sub
-
- <Test()> _
- Public Sub Normalize3()
- ' {[12 CHF][7 USD]} - {[12 CHF][3 USD]} == [4 USD]
- Dim s1() As Money = New Money() {New Money(12, "CHF"), New Money(3, "USD")}
- Dim ms1 As New MoneyBag(s1)
- Dim expected As New Money(4, "USD")
- Assert.AreEqual(expected, fMB1.Subtract(ms1))
- End Sub
-
- <Test()> _
- Public Sub Normalize4()
- ' [12 CHF] - {[12 CHF][3 USD]} == [-3 USD]
- Dim s1() As Money = New Money() {New Money(12, "CHF"), New Money(3, "USD")}
- Dim ms1 As New MoneyBag(s1)
- Dim expected As New Money(-3, "USD")
- Assert.AreEqual(expected, f12CHF.Subtract(ms1))
- End Sub
-
- <Test()> _
- Public Sub Print()
- Assert.AreEqual("[12 CHF]", f12CHF.ToString())
- End Sub
-
- <Test()> _
- Public Sub SimpleAdd()
-
- ' [12 CHF] + [14 CHF] == [26 CHF]
- Dim expected As Money = New Money(26, "CHF")
- Assert.AreEqual(expected, f12CHF.Add(f14CHF))
-
- End Sub
-
- <Test()> _
- Public Sub SimpleNegate()
-
- ' [14 CHF] negate == [-14 CHF]
- Dim expected As New Money(-14, "CHF")
- Assert.AreEqual(expected, f14CHF.Negate())
-
- End Sub
-
- <Test()> _
- Public Sub SimpleSubtract()
-
- ' [14 CHF] - [12 CHF] == [2 CHF]
- Dim expected As New Money(2, "CHF")
- Assert.AreEqual(expected, f14CHF.Subtract(f12CHF))
-
- End Sub
-
- <Test()> _
- Public Sub SimpleMultiply()
-
- ' [14 CHF] *2 == [28 CHF]
- Dim expected As New Money(28, "CHF")
- Assert.AreEqual(expected, f14CHF.Multiply(2))
-
- End Sub
-
- End Class
-
-End Namespace
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/vb-money.build
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/vb-money.build b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/vb-money.build
deleted file mode 100644
index 0d3cc04..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/vb-money.build
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?>
-<project name="vb-money" default="build">
-
- <include buildfile="../../samples.common" />
-
- <patternset id="source-files">
- <include name="AssemblyInfo.vb" />
- <include name="IMoney.vb" />
- <include name="Money.vb" />
- <include name="MoneyBag.vb" />
- <include name="MoneyTest.vb" />
- </patternset>
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/vb-money.vbproj
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/vb-money.vbproj b/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/vb-money.vbproj
deleted file mode 100644
index b98e920..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/money/vb-money.vbproj
+++ /dev/null
@@ -1,28 +0,0 @@
-<VisualStudioProject>
- <VisualBasic ProjectType="Local" ProductVersion="7.10.3077" SchemaVersion="2.0" ProjectGuid="{95394B96-A794-48EA-9879-0E4EC79C5724}">
- <Build>
- <Settings ApplicationIcon="" AssemblyKeyContainerName="" AssemblyName="vb-money" AssemblyOriginatorKeyFile="" AssemblyOriginatorKeyMode="None" DefaultClientScript="JScript" DefaultHTMLPageLayout="Grid" DefaultTargetSchema="IE50" DelaySign="false" OutputType="Library" OptionCompare="Binary" OptionExplicit="On" OptionStrict="Off" RootNamespace="Money" StartupObject="">
- <Config Name="Debug" BaseAddress="285212672" ConfigurationOverrideFile="" DefineConstants="" DefineDebug="true" DefineTrace="true" DebugSymbols="true" IncrementalBuild="true" Optimize="false" OutputPath="bin\" RegisterForComInterop="false" RemoveIntegerChecks="false" TreatWarningsAsErrors="false" WarningLevel="1" />
- <Config Name="Release" BaseAddress="285212672" ConfigurationOverrideFile="" DefineConstants="" DefineDebug="false" DefineTrace="true" DebugSymbols="false" IncrementalBuild="false" Optimize="true" OutputPath="bin\" RegisterForComInterop="false" RemoveIntegerChecks="false" TreatWarningsAsErrors="false" WarningLevel="1" />
- </Settings>
- <References>
- <Reference Name="System" AssemblyName="System" />
- <Reference Name="nunit.framework" AssemblyName="nunit.framework, Version=2.5, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" HintPath="..\..\..\bin\net-1.1\framework\nunit.framework.dll" />
- </References>
- <Imports>
- <Import Namespace="Microsoft.VisualBasic" />
- <Import Namespace="System" />
- <Import Namespace="System.Collections" />
- </Imports>
- </Build>
- <Files>
- <Include>
- <File RelPath="AssemblyInfo.vb" SubType="Code" BuildAction="Compile" />
- <File RelPath="IMoney.vb" SubType="Code" BuildAction="Compile" />
- <File RelPath="Money.vb" SubType="Code" BuildAction="Compile" />
- <File RelPath="MoneyBag.vb" SubType="Code" BuildAction="Compile" />
- <File RelPath="MoneyTest.vb" SubType="Code" BuildAction="Compile" />
- </Include>
- </Files>
- </VisualBasic>
-</VisualStudioProject>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/AssemblyInfo.vb
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/AssemblyInfo.vb b/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/AssemblyInfo.vb
deleted file mode 100644
index e29c3d4..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/AssemblyInfo.vb
+++ /dev/null
@@ -1,32 +0,0 @@
-Imports System
-Imports System.Reflection
-Imports 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.
-
-' Review the values of the assembly attributes
-
-<Assembly: AssemblyTitle("")>
-<Assembly: AssemblyDescription("")>
-<Assembly: AssemblyCompany("")>
-<Assembly: AssemblyProduct("")>
-<Assembly: AssemblyCopyright("")>
-<Assembly: AssemblyTrademark("")>
-<Assembly: CLSCompliant(True)>
-
-'The following GUID is for the ID of the typelib if this project is exposed to COM
-<Assembly: Guid("966C964A-3C92-4834-AC3A-9A47BA0A728B")>
-
-' 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.*")>
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/AssertSyntaxTests.vb
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/AssertSyntaxTests.vb b/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/AssertSyntaxTests.vb
deleted file mode 100644
index bec1e0b..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/AssertSyntaxTests.vb
+++ /dev/null
@@ -1,705 +0,0 @@
-' ****************************************************************
-' Copyright 2007, Charlie Poole
-' This is free software licensed under the NUnit license. You may
-' obtain a copy of the license at http:'nunit.org/?p=license&r=2.4
-' ****************************************************************
-
-Option Explicit On
-
-Imports System
-Imports NUnit.Framework
-Imports NUnit.Framework.Constraints
-Imports Text = NUnit.Framework.Text
-
-Namespace NUnit.Samples
-
- ' This test fixture attempts to exercise all the syntactic
- ' variations of Assert without getting into failures, errors
- ' or corner cases. Thus, some of the tests may be duplicated
- ' in other fixtures.
- '
- ' Each test performs the same operations using the classic
- ' syntax (if available) and the new syntax in both the
- ' helper-based and inherited forms.
- '
- ' This Fixture will eventually be duplicated in other
- ' supported languages.
-
- <TestFixture()> _
- Public Class AssertSyntaxTests
- Inherits AssertionHelper
-
-#Region "Simple Constraint Tests"
- <Test()> _
- Public Sub IsNull()
- Dim nada As Object = Nothing
-
- ' Classic syntax
- Assert.IsNull(nada)
-
- ' Helper syntax
- Assert.That(nada, Iz.Null)
-
- ' Inherited syntax
- Expect(nada, Null)
- End Sub
-
-
- <Test()> _
- Public Sub IsNotNull()
- ' Classic syntax
- Assert.IsNotNull(42)
-
- ' Helper syntax
- Assert.That(42, Iz.Not.Null)
-
- ' Inherited syntax
- Expect(42, Iz.Not.Null)
- End Sub
-
- <Test()> _
- Public Sub IsTrue()
- ' Classic syntax
- Assert.IsTrue(2 + 2 = 4)
-
- ' Helper syntax
- Assert.That(2 + 2 = 4, Iz.True)
- Assert.That(2 + 2 = 4)
-
- ' Inherited syntax
- Expect(2 + 2 = 4, Iz.True)
- Expect(2 + 2 = 4)
- End Sub
-
- <Test()> _
- Public Sub IsFalse()
- ' Classic syntax
- Assert.IsFalse(2 + 2 = 5)
-
- ' Helper syntax
- Assert.That(2 + 2 = 5, Iz.False)
-
- ' Inherited syntax
- Expect(2 + 2 = 5, Iz.False)
- End Sub
-
- <Test()> _
- Public Sub IsNaN()
- Dim d As Double = Double.NaN
- Dim f As Single = Single.NaN
-
- ' Classic syntax
- Assert.IsNaN(d)
- Assert.IsNaN(f)
-
- ' Helper syntax
- Assert.That(d, Iz.NaN)
- Assert.That(f, Iz.NaN)
-
- ' Inherited syntax
- Expect(d, NaN)
- Expect(f, NaN)
- End Sub
-
- <Test()> _
- Public Sub EmptyStringTests()
- ' Classic syntax
- Assert.IsEmpty("")
- Assert.IsNotEmpty("Hello!")
-
- ' Helper syntax
- Assert.That("", Iz.Empty)
- Assert.That("Hello!", Iz.Not.Empty)
-
- ' Inherited syntax
- Expect("", Empty)
- Expect("Hello!", Iz.Not.Empty)
- End Sub
-
- <Test()> _
- Public Sub EmptyCollectionTests()
-
- Dim boolArray As Boolean() = New Boolean() {}
- Dim nonEmpty As Integer() = New Integer() {1, 2, 3}
-
- ' Classic syntax
- Assert.IsEmpty(boolArray)
- Assert.IsNotEmpty(nonEmpty)
-
- ' Helper syntax
- Assert.That(boolArray, Iz.Empty)
- Assert.That(nonEmpty, Iz.Not.Empty)
-
- ' Inherited syntax
- Expect(boolArray, Iz.Empty)
- Expect(nonEmpty, Iz.Not.Empty)
- End Sub
-#End Region
-
-#Region "TypeConstraint Tests"
- <Test()> _
- Public Sub ExactTypeTests()
- ' Classic syntax workarounds
- Assert.AreEqual(GetType(String), "Hello".GetType())
- Assert.AreEqual("System.String", "Hello".GetType().FullName)
- Assert.AreNotEqual(GetType(Integer), "Hello".GetType())
- Assert.AreNotEqual("System.Int32", "Hello".GetType().FullName)
-
- ' Helper syntax
- Assert.That("Hello", Iz.TypeOf(GetType(String)))
- Assert.That("Hello", Iz.Not.TypeOf(GetType(Integer)))
-
- ' Inherited syntax
- Expect("Hello", Iz.TypeOf(GetType(String)))
- Expect("Hello", Iz.Not.TypeOf(GetType(Integer)))
- End Sub
-
- <Test()> _
- Public Sub InstanceOfTypeTests()
- ' Classic syntax
- Assert.IsInstanceOf(GetType(String), "Hello")
- Assert.IsNotInstanceOf(GetType(String), 5)
-
- ' Helper syntax
- Assert.That("Hello", Iz.InstanceOf(GetType(String)))
- Assert.That(5, Iz.Not.InstanceOf(GetType(String)))
-
- ' Inherited syntax
- Expect("Hello", InstanceOf(GetType(String)))
- Expect(5, Iz.Not.InstanceOf(GetType(String)))
- End Sub
-
- <Test()> _
- Public Sub AssignableFromTypeTests()
- ' Classic syntax
- Assert.IsAssignableFrom(GetType(String), "Hello")
- Assert.IsNotAssignableFrom(GetType(String), 5)
-
- ' Helper syntax
- Assert.That("Hello", Iz.AssignableFrom(GetType(String)))
- Assert.That(5, Iz.Not.AssignableFrom(GetType(String)))
-
- ' Inherited syntax
- Expect("Hello", AssignableFrom(GetType(String)))
- Expect(5, Iz.Not.AssignableFrom(GetType(String)))
- End Sub
-#End Region
-
-#Region "StringConstraintTests"
- <Test()> _
- Public Sub SubstringTests()
- Dim phrase As String = "Hello World!"
- Dim array As String() = New String() {"abc", "bad", "dba"}
-
- ' Classic Syntax
- StringAssert.Contains("World", phrase)
-
- ' Helper syntax
- Assert.That(phrase, Text.Contains("World"))
- ' Only available using new syntax
- Assert.That(phrase, Text.DoesNotContain("goodbye"))
- Assert.That(phrase, Text.Contains("WORLD").IgnoreCase)
- Assert.That(phrase, Text.DoesNotContain("BYE").IgnoreCase)
- Assert.That(array, Text.All.Contains("b"))
-
- ' Inherited syntax
- Expect(phrase, Contains("World"))
- ' Only available using new syntax
- Expect(phrase, Text.DoesNotContain("goodbye"))
- Expect(phrase, Contains("WORLD").IgnoreCase)
- Expect(phrase, Text.DoesNotContain("BYE").IgnoreCase)
- Expect(array, All.Contains("b"))
- End Sub
-
- <Test()> _
- Public Sub StartsWithTests()
- Dim phrase As String = "Hello World!"
- Dim greetings As String() = New String() {"Hello!", "Hi!", "Hola!"}
-
- ' Classic syntax
- StringAssert.StartsWith("Hello", phrase)
-
- ' Helper syntax
- Assert.That(phrase, Text.StartsWith("Hello"))
- ' Only available using new syntax
- Assert.That(phrase, Text.DoesNotStartWith("Hi!"))
- Assert.That(phrase, Text.StartsWith("HeLLo").IgnoreCase)
- Assert.That(phrase, Text.DoesNotStartWith("HI").IgnoreCase)
- Assert.That(greetings, Text.All.StartsWith("h").IgnoreCase)
-
- ' Inherited syntax
- Expect(phrase, StartsWith("Hello"))
- ' Only available using new syntax
- Expect(phrase, Text.DoesNotStartWith("Hi!"))
- Expect(phrase, StartsWith("HeLLo").IgnoreCase)
- Expect(phrase, Text.DoesNotStartWith("HI").IgnoreCase)
- Expect(greetings, All.StartsWith("h").IgnoreCase)
- End Sub
-
- <Test()> _
- Public Sub EndsWithTests()
- Dim phrase As String = "Hello World!"
- Dim greetings As String() = New String() {"Hello!", "Hi!", "Hola!"}
-
- ' Classic Syntax
- StringAssert.EndsWith("!", phrase)
-
- ' Helper syntax
- Assert.That(phrase, Text.EndsWith("!"))
- ' Only available using new syntax
- Assert.That(phrase, Text.DoesNotEndWith("?"))
- Assert.That(phrase, Text.EndsWith("WORLD!").IgnoreCase)
- Assert.That(greetings, Text.All.EndsWith("!"))
-
- ' Inherited syntax
- Expect(phrase, EndsWith("!"))
- ' Only available using new syntax
- Expect(phrase, Text.DoesNotEndWith("?"))
- Expect(phrase, EndsWith("WORLD!").IgnoreCase)
- Expect(greetings, All.EndsWith("!"))
- End Sub
-
- <Test()> _
- Public Sub EqualIgnoringCaseTests()
-
- Dim phrase As String = "Hello World!"
- Dim array1 As String() = New String() {"Hello", "World"}
- Dim array2 As String() = New String() {"HELLO", "WORLD"}
- Dim array3 As String() = New String() {"HELLO", "Hello", "hello"}
-
- ' Classic syntax
- StringAssert.AreEqualIgnoringCase("hello world!", phrase)
-
- ' Helper syntax
- Assert.That(phrase, Iz.EqualTo("hello world!").IgnoreCase)
- 'Only available using new syntax
- Assert.That(phrase, Iz.Not.EqualTo("goodbye world!").IgnoreCase)
- Assert.That(array1, Iz.EqualTo(array2).IgnoreCase)
- Assert.That(array3, Iz.All.EqualTo("hello").IgnoreCase)
-
- ' Inherited syntax
- Expect(phrase, EqualTo("hello world!").IgnoreCase)
- 'Only available using new syntax
- Expect(phrase, Iz.Not.EqualTo("goodbye world!").IgnoreCase)
- Expect(array1, EqualTo(array2).IgnoreCase)
- Expect(array3, All.EqualTo("hello").IgnoreCase)
- End Sub
-
- <Test()> _
- Public Sub RegularExpressionTests()
- Dim phrase As String = "Now is the time for all good men to come to the aid of their country."
- Dim quotes As String() = New String() {"Never say never", "It's never too late", "Nevermore!"}
-
- ' Classic syntax
- StringAssert.IsMatch("all good men", phrase)
- StringAssert.IsMatch("Now.*come", phrase)
-
- ' Helper syntax
- Assert.That(phrase, Text.Matches("all good men"))
- Assert.That(phrase, Text.Matches("Now.*come"))
- ' Only available using new syntax
- Assert.That(phrase, Text.DoesNotMatch("all.*men.*good"))
- Assert.That(phrase, Text.Matches("ALL").IgnoreCase)
- Assert.That(quotes, Text.All.Matches("never").IgnoreCase)
-
- ' Inherited syntax
- Expect(phrase, Matches("all good men"))
- Expect(phrase, Matches("Now.*come"))
- ' Only available using new syntax
- Expect(phrase, Text.DoesNotMatch("all.*men.*good"))
- Expect(phrase, Matches("ALL").IgnoreCase)
- Expect(quotes, All.Matches("never").IgnoreCase)
- End Sub
-#End Region
-
-#Region "Equality Tests"
- <Test()> _
- Public Sub EqualityTests()
-
- Dim i3 As Integer() = {1, 2, 3}
- Dim d3 As Double() = {1.0, 2.0, 3.0}
- Dim iunequal As Integer() = {1, 3, 2}
-
- ' Classic Syntax
- Assert.AreEqual(4, 2 + 2)
- Assert.AreEqual(i3, d3)
- Assert.AreNotEqual(5, 2 + 2)
- Assert.AreNotEqual(i3, iunequal)
-
- ' Helper syntax
- Assert.That(2 + 2, Iz.EqualTo(4))
- Assert.That(2 + 2 = 4)
- Assert.That(i3, Iz.EqualTo(d3))
- Assert.That(2 + 2, Iz.Not.EqualTo(5))
- Assert.That(i3, Iz.Not.EqualTo(iunequal))
-
- ' Inherited syntax
- Expect(2 + 2, EqualTo(4))
- Expect(2 + 2 = 4)
- Expect(i3, EqualTo(d3))
- Expect(2 + 2, Iz.Not.EqualTo(5))
- Expect(i3, Iz.Not.EqualTo(iunequal))
- End Sub
-
- <Test()> _
- Public Sub EqualityTestsWithTolerance()
- ' CLassic syntax
- Assert.AreEqual(5.0R, 4.99R, 0.05R)
- Assert.AreEqual(5.0F, 4.99F, 0.05F)
-
- ' Helper syntax
- Assert.That(4.99R, Iz.EqualTo(5.0R).Within(0.05R))
- Assert.That(4D, Iz.Not.EqualTo(5D).Within(0.5D))
- Assert.That(4.99F, Iz.EqualTo(5.0F).Within(0.05F))
- Assert.That(4.99D, Iz.EqualTo(5D).Within(0.05D))
- Assert.That(499, Iz.EqualTo(500).Within(5))
- Assert.That(4999999999L, Iz.EqualTo(5000000000L).Within(5L))
-
- ' Inherited syntax
- Expect(4.99R, EqualTo(5.0R).Within(0.05R))
- Expect(4D, Iz.Not.EqualTo(5D).Within(0.5D))
- Expect(4.99F, EqualTo(5.0F).Within(0.05F))
- Expect(4.99D, EqualTo(5D).Within(0.05D))
- Expect(499, EqualTo(500).Within(5))
- Expect(4999999999L, EqualTo(5000000000L).Within(5L))
- End Sub
-
- <Test()> _
- Public Sub EqualityTestsWithTolerance_MixedFloatAndDouble()
- ' Bug Fix 1743844
- Assert.That(2.20492R, Iz.EqualTo(2.2R).Within(0.01F), _
- "Double actual, Double expected, Single tolerance")
- Assert.That(2.20492R, Iz.EqualTo(2.2F).Within(0.01R), _
- "Double actual, Single expected, Double tolerance")
- Assert.That(2.20492R, Iz.EqualTo(2.2F).Within(0.01F), _
- "Double actual, Single expected, Single tolerance")
- Assert.That(2.20492F, Iz.EqualTo(2.2F).Within(0.01R), _
- "Single actual, Single expected, Double tolerance")
- Assert.That(2.20492F, Iz.EqualTo(2.2R).Within(0.01R), _
- "Single actual, Double expected, Double tolerance")
- Assert.That(2.20492F, Iz.EqualTo(2.2R).Within(0.01F), _
- "Single actual, Double expected, Single tolerance")
- End Sub
-
- <Test()> _
- Public Sub EqualityTestsWithTolerance_MixingTypesGenerally()
- ' Extending tolerance to all numeric types
- Assert.That(202.0R, Iz.EqualTo(200.0R).Within(2), _
- "Double actual, Double expected, int tolerance")
- Assert.That(4.87D, Iz.EqualTo(5).Within(0.25R), _
- "Decimal actual, int expected, Double tolerance")
- Assert.That(4.87D, Iz.EqualTo(5L).Within(1), _
- "Decimal actual, long expected, int tolerance")
- Assert.That(487, Iz.EqualTo(500).Within(25), _
- "int actual, int expected, int tolerance")
- Assert.That(487L, Iz.EqualTo(500).Within(25), _
- "long actual, int expected, int tolerance")
- End Sub
-#End Region
-
-#Region "Comparison Tests"
- <Test()> _
- Public Sub ComparisonTests()
- ' Classic Syntax
- Assert.Greater(7, 3)
- Assert.GreaterOrEqual(7, 3)
- Assert.GreaterOrEqual(7, 7)
-
- ' Helper syntax
- Assert.That(7, Iz.GreaterThan(3))
- Assert.That(7, Iz.GreaterThanOrEqualTo(3))
- Assert.That(7, Iz.AtLeast(3))
- Assert.That(7, Iz.GreaterThanOrEqualTo(7))
- Assert.That(7, Iz.AtLeast(7))
-
- ' Inherited syntax
- Expect(7, GreaterThan(3))
- Expect(7, GreaterThanOrEqualTo(3))
- Expect(7, AtLeast(3))
- Expect(7, GreaterThanOrEqualTo(7))
- Expect(7, AtLeast(7))
-
- ' Classic syntax
- Assert.Less(3, 7)
- Assert.LessOrEqual(3, 7)
- Assert.LessOrEqual(3, 3)
-
- ' Helper syntax
- Assert.That(3, Iz.LessThan(7))
- Assert.That(3, Iz.LessThanOrEqualTo(7))
- Assert.That(3, Iz.AtMost(7))
- Assert.That(3, Iz.LessThanOrEqualTo(3))
- Assert.That(3, Iz.AtMost(3))
-
- ' Inherited syntax
- Expect(3, LessThan(7))
- Expect(3, LessThanOrEqualTo(7))
- Expect(3, AtMost(7))
- Expect(3, LessThanOrEqualTo(3))
- Expect(3, AtMost(3))
- End Sub
-#End Region
-
-#Region "Collection Tests"
- <Test()> _
- Public Sub AllItemsTests()
-
- Dim ints As Object() = {1, 2, 3, 4}
- Dim doubles As Object() = {0.99, 2.1, 3.0, 4.05}
- Dim strings As Object() = {"abc", "bad", "cab", "bad", "dad"}
-
- ' Classic syntax
- CollectionAssert.AllItemsAreNotNull(ints)
- CollectionAssert.AllItemsAreInstancesOfType(ints, GetType(Integer))
- CollectionAssert.AllItemsAreInstancesOfType(strings, GetType(String))
- CollectionAssert.AllItemsAreUnique(ints)
-
- ' Helper syntax
- Assert.That(ints, Iz.All.Not.Null)
- Assert.That(ints, Has.None.Null)
- Assert.That(ints, Iz.All.InstanceOfType(GetType(Integer)))
- Assert.That(ints, Has.All.InstanceOfType(GetType(Integer)))
- Assert.That(strings, Iz.All.InstanceOfType(GetType(String)))
- Assert.That(strings, Has.All.InstanceOfType(GetType(String)))
- Assert.That(ints, Iz.Unique)
- ' Only available using new syntax
- Assert.That(strings, Iz.Not.Unique)
- Assert.That(ints, Iz.All.GreaterThan(0))
- Assert.That(ints, Has.All.GreaterThan(0))
- Assert.That(ints, Has.None.LessThanOrEqualTo(0))
- Assert.That(strings, Text.All.Contains("a"))
- Assert.That(strings, Has.All.Contains("a"))
- Assert.That(strings, Has.Some.StartsWith("ba"))
- Assert.That(strings, Has.Some.Property("Length").EqualTo(3))
- Assert.That(strings, Has.Some.StartsWith("BA").IgnoreCase)
- Assert.That(doubles, Has.Some.EqualTo(1.0).Within(0.05))
-
- ' Inherited syntax
- Expect(ints, All.Not.Null)
- Expect(ints, None.Null)
- Expect(ints, All.InstanceOfType(GetType(Integer)))
- Expect(strings, All.InstanceOfType(GetType(String)))
- Expect(ints, Unique)
- ' Only available using new syntax
- Expect(strings, Iz.Not.Unique)
- Expect(ints, All.GreaterThan(0))
- Expect(strings, All.Contains("a"))
- Expect(strings, Some.StartsWith("ba"))
- Expect(strings, Some.StartsWith("BA").IgnoreCase)
- Expect(doubles, Some.EqualTo(1.0).Within(0.05))
- End Sub
-
- <Test()> _
- Public Sub SomeItemsTests()
-
- Dim mixed As Object() = {1, 2, "3", Nothing, "four", 100}
- Dim strings As Object() = {"abc", "bad", "cab", "bad", "dad"}
-
- ' Not available using the classic syntax
-
- ' Helper syntax
- Assert.That(mixed, Has.Some.Null)
- Assert.That(mixed, Has.Some.InstanceOfType(GetType(Integer)))
- Assert.That(mixed, Has.Some.InstanceOfType(GetType(String)))
- Assert.That(strings, Has.Some.StartsWith("ba"))
- Assert.That(strings, Has.Some.Not.StartsWith("ba"))
-
- ' Inherited syntax
- Expect(mixed, Some.Null)
- Expect(mixed, Some.InstanceOfType(GetType(Integer)))
- Expect(mixed, Some.InstanceOfType(GetType(String)))
- Expect(strings, Some.StartsWith("ba"))
- Expect(strings, Some.Not.StartsWith("ba"))
- End Sub
-
- <Test()> _
- Public Sub NoItemsTests()
-
- Dim ints As Object() = {1, 2, 3, 4, 5}
- Dim strings As Object() = {"abc", "bad", "cab", "bad", "dad"}
-
- ' Not available using the classic syntax
-
- ' Helper syntax
- Assert.That(ints, Has.None.Null)
- Assert.That(ints, Has.None.InstanceOfType(GetType(String)))
- Assert.That(ints, Has.None.GreaterThan(99))
- Assert.That(strings, Has.None.StartsWith("qu"))
-
- ' Inherited syntax
- Expect(ints, None.Null)
- Expect(ints, None.InstanceOfType(GetType(String)))
- Expect(ints, None.GreaterThan(99))
- Expect(strings, None.StartsWith("qu"))
- End Sub
-
- <Test()> _
- Public Sub CollectionContainsTests()
-
- Dim iarray As Integer() = {1, 2, 3}
- Dim sarray As String() = {"a", "b", "c"}
-
- ' Classic syntax
- Assert.Contains(3, iarray)
- Assert.Contains("b", sarray)
- CollectionAssert.Contains(iarray, 3)
- CollectionAssert.Contains(sarray, "b")
- CollectionAssert.DoesNotContain(sarray, "x")
- ' Showing that Contains uses NUnit equality
- CollectionAssert.Contains(iarray, 1.0R)
-
- ' Helper syntax
- Assert.That(iarray, Has.Member(3))
- Assert.That(sarray, Has.Member("b"))
- Assert.That(sarray, Has.No.Member("x"))
- ' Showing that Contains uses NUnit equality
- Assert.That(iarray, Has.Member(1.0R))
-
- ' Only available using the new syntax
- ' Note that EqualTo and SameAs do NOT give
- ' identical results to Contains because
- ' Contains uses Object.Equals()
- Assert.That(iarray, Has.Some.EqualTo(3))
- Assert.That(iarray, Has.Member(3))
- Assert.That(sarray, Has.Some.EqualTo("b"))
- Assert.That(sarray, Has.None.EqualTo("x"))
- Assert.That(iarray, Has.None.SameAs(1.0R))
- Assert.That(iarray, Has.All.LessThan(10))
- Assert.That(sarray, Has.All.Length.EqualTo(1))
- Assert.That(sarray, Has.None.Property("Length").GreaterThan(3))
-
- ' Inherited syntax
- Expect(iarray, Contains(3))
- Expect(sarray, Contains("b"))
- Expect(sarray, Has.No.Member("x"))
-
- ' Only available using new syntax
- ' Note that EqualTo and SameAs do NOT give
- ' identical results to Contains because
- ' Contains uses Object.Equals()
- Expect(iarray, Some.EqualTo(3))
- Expect(sarray, Some.EqualTo("b"))
- Expect(sarray, None.EqualTo("x"))
- Expect(iarray, All.LessThan(10))
- Expect(sarray, All.Length.EqualTo(1))
- Expect(sarray, None.Property("Length").GreaterThan(3))
- End Sub
-
- <Test()> _
- Public Sub CollectionEquivalenceTests()
-
- Dim ints1to5 As Integer() = {1, 2, 3, 4, 5}
- Dim twothrees As Integer() = {1, 2, 3, 3, 4, 5}
- Dim twofours As Integer() = {1, 2, 3, 4, 4, 5}
-
- ' Classic syntax
- CollectionAssert.AreEquivalent(New Integer() {2, 1, 4, 3, 5}, ints1to5)
- CollectionAssert.AreNotEquivalent(New Integer() {2, 2, 4, 3, 5}, ints1to5)
- CollectionAssert.AreNotEquivalent(New Integer() {2, 4, 3, 5}, ints1to5)
- CollectionAssert.AreNotEquivalent(New Integer() {2, 2, 1, 1, 4, 3, 5}, ints1to5)
- CollectionAssert.AreNotEquivalent(twothrees, twofours)
-
- ' Helper syntax
- Assert.That(New Integer() {2, 1, 4, 3, 5}, Iz.EquivalentTo(ints1to5))
- Assert.That(New Integer() {2, 2, 4, 3, 5}, Iz.Not.EquivalentTo(ints1to5))
- Assert.That(New Integer() {2, 4, 3, 5}, Iz.Not.EquivalentTo(ints1to5))
- Assert.That(New Integer() {2, 2, 1, 1, 4, 3, 5}, Iz.Not.EquivalentTo(ints1to5))
- Assert.That(twothrees, Iz.Not.EquivalentTo(twofours))
-
- ' Inherited syntax
- Expect(New Integer() {2, 1, 4, 3, 5}, EquivalentTo(ints1to5))
- End Sub
-
- <Test()> _
- Public Sub SubsetTests()
-
- Dim ints1to5 As Integer() = {1, 2, 3, 4, 5}
-
- ' Classic syntax
- CollectionAssert.IsSubsetOf(New Integer() {1, 3, 5}, ints1to5)
- CollectionAssert.IsSubsetOf(New Integer() {1, 2, 3, 4, 5}, ints1to5)
- CollectionAssert.IsNotSubsetOf(New Integer() {2, 4, 6}, ints1to5)
- CollectionAssert.IsNotSubsetOf(New Integer() {1, 2, 2, 2, 5}, ints1to5)
-
- ' Helper syntax
- Assert.That(New Integer() {1, 3, 5}, Iz.SubsetOf(ints1to5))
- Assert.That(New Integer() {1, 2, 3, 4, 5}, Iz.SubsetOf(ints1to5))
- Assert.That(New Integer() {2, 4, 6}, Iz.Not.SubsetOf(ints1to5))
-
- ' Inherited syntax
- Expect(New Integer() {1, 3, 5}, SubsetOf(ints1to5))
- Expect(New Integer() {1, 2, 3, 4, 5}, SubsetOf(ints1to5))
- Expect(New Integer() {2, 4, 6}, Iz.Not.SubsetOf(ints1to5))
- End Sub
-#End Region
-
-#Region "Property Tests"
- <Test()> _
- Public Sub PropertyTests()
-
- Dim array As String() = {"abc", "bca", "xyz", "qrs"}
- Dim array2 As String() = {"a", "ab", "abc"}
- Dim list As New ArrayList(array)
-
- ' Not available using the classic syntax
-
- ' Helper syntax
- ' Assert.That(list, Has.Property("Count"))
- ' Assert.That(list, Has.No.Property("Length"))
-
- Assert.That("Hello", Has.Length.EqualTo(5))
- Assert.That("Hello", Has.Property("Length").EqualTo(5))
- Assert.That("Hello", Has.Property("Length").GreaterThan(3))
-
- Assert.That(array, Has.Property("Length").EqualTo(4))
- Assert.That(array, Has.Length.EqualTo(4))
- Assert.That(array, Has.Property("Length").LessThan(10))
-
- Assert.That(array, Has.All.Property("Length").EqualTo(3))
- Assert.That(array, Has.All.Length.EqualTo(3))
- Assert.That(array, Iz.All.Length.EqualTo(3))
- Assert.That(array, Has.All.Property("Length").EqualTo(3))
- Assert.That(array, Iz.All.Property("Length").EqualTo(3))
-
- Assert.That(array2, Iz.Not.Property("Length").EqualTo(4))
- Assert.That(array2, Iz.Not.Length.EqualTo(4))
- Assert.That(array2, Has.No.Property("Length").GreaterThan(3))
-
- ' Inherited syntax
- ' Expect(list, Has.Property("Count"))
- ' Expect(list, Has.No.Property("Nada"))
-
- Expect(array, All.Property("Length").EqualTo(3))
- Expect(array, All.Length.EqualTo(3))
- End Sub
-#End Region
-
-#Region "Not Tests"
- <Test()> _
- Public Sub NotTests()
- ' Not available using the classic syntax
-
- ' Helper syntax
- Assert.That(42, Iz.Not.Null)
- Assert.That(42, Iz.Not.True)
- Assert.That(42, Iz.Not.False)
- Assert.That(2.5, Iz.Not.NaN)
- Assert.That(2 + 2, Iz.Not.EqualTo(3))
- Assert.That(2 + 2, Iz.Not.Not.EqualTo(4))
- Assert.That(2 + 2, Iz.Not.Not.Not.EqualTo(5))
-
- ' Inherited syntax
- Expect(42, Iz.Not.Null)
- Expect(42, Iz.Not.True)
- Expect(42, Iz.Not.False)
- Expect(2.5, Iz.Not.NaN)
- Expect(2 + 2, Iz.Not.EqualTo(3))
- Expect(2 + 2, Iz.Not.Not.EqualTo(4))
- Expect(2 + 2, Iz.Not.Not.Not.EqualTo(5))
- End Sub
-#End Region
-
- End Class
-
-End Namespace
-
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/vb-syntax.build
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/vb-syntax.build b/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/vb-syntax.build
deleted file mode 100644
index aa0f584..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/vb-syntax.build
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<project name="vb-syntax" default="build">
-
- <include buildfile="../../samples.common" />
-
- <patternset id="source-files">
- <include name="AssemblyInfo.vb" />
- <include name="AssertSyntaxTests.vb" />
- </patternset>
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/vb-syntax.vbproj
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/vb-syntax.vbproj b/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/vb-syntax.vbproj
deleted file mode 100644
index 5dac155..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/syntax/vb-syntax.vbproj
+++ /dev/null
@@ -1,29 +0,0 @@
-<VisualStudioProject>
- <VisualBasic ProjectType="Local" ProductVersion="7.10.3077" SchemaVersion="2.0" ProjectGuid="{6BEF566A-2691-4EE8-91AF-0390CCCDDAF1}">
- <Build>
- <Settings ApplicationIcon="" AssemblyKeyContainerName="" AssemblyName="vb-syntax" AssemblyOriginatorKeyFile="" AssemblyOriginatorKeyMode="None" DefaultClientScript="JScript" DefaultHTMLPageLayout="Grid" DefaultTargetSchema="IE50" DelaySign="false" OutputType="Library" OptionCompare="Binary" OptionExplicit="On" OptionStrict="Off" RootNamespace="NUnit.Samples" StartupObject="NUnit.Samples.(None)">
- <Config Name="Debug" BaseAddress="285212672" ConfigurationOverrideFile="" DefineConstants="" DefineDebug="true" DefineTrace="true" DebugSymbols="true" IncrementalBuild="true" Optimize="false" OutputPath="bin\" RegisterForComInterop="false" RemoveIntegerChecks="false" TreatWarningsAsErrors="false" WarningLevel="1" />
- <Config Name="Release" BaseAddress="285212672" ConfigurationOverrideFile="" DefineConstants="" DefineDebug="false" DefineTrace="true" DebugSymbols="false" IncrementalBuild="false" Optimize="true" OutputPath="bin\" RegisterForComInterop="false" RemoveIntegerChecks="false" TreatWarningsAsErrors="false" WarningLevel="1" />
- </Settings>
- <References>
- <Reference Name="System" AssemblyName="System" />
- <Reference Name="System.Data" AssemblyName="System.Data" />
- <Reference Name="System.XML" AssemblyName="System.Xml" />
- <Reference Name="nunit.framework" AssemblyName="nunit.framework, Version=2.5, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" HintPath="..\..\..\bin\net-1.1\framework\nunit.framework.dll" />
- </References>
- <Imports>
- <Import Namespace="Microsoft.VisualBasic" />
- <Import Namespace="System" />
- <Import Namespace="System.Collections" />
- <Import Namespace="System.Data" />
- <Import Namespace="System.Diagnostics" />
- </Imports>
- </Build>
- <Files>
- <Include>
- <File RelPath="AssemblyInfo.vb" SubType="Code" BuildAction="Compile" />
- <File RelPath="AssertSyntaxTests.vb" SubType="Code" BuildAction="Compile" />
- </Include>
- </Files>
- </VisualBasic>
-</VisualStudioProject>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/samples/vb/vb-samples.sln
----------------------------------------------------------------------
diff --git a/lib/NUnit.org/NUnit/2.5.9/samples/vb/vb-samples.sln b/lib/NUnit.org/NUnit/2.5.9/samples/vb/vb-samples.sln
deleted file mode 100644
index 7bf8156..0000000
--- a/lib/NUnit.org/NUnit/2.5.9/samples/vb/vb-samples.sln
+++ /dev/null
@@ -1,37 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "vb-failures", "failures\vb-failures.vbproj", "{F199991B-6C8E-4AB0-9AAA-703CD4897700}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "vb-money", "money\vb-money.vbproj", "{95394B96-A794-48EA-9879-0E4EC79C5724}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "vb-syntax", "syntax\vb-syntax.vbproj", "{6BEF566A-2691-4EE8-91AF-0390CCCDDAF1}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {F199991B-6C8E-4AB0-9AAA-703CD4897700}.Debug.ActiveCfg = Debug|.NET
- {F199991B-6C8E-4AB0-9AAA-703CD4897700}.Debug.Build.0 = Debug|.NET
- {F199991B-6C8E-4AB0-9AAA-703CD4897700}.Release.ActiveCfg = Release|.NET
- {F199991B-6C8E-4AB0-9AAA-703CD4897700}.Release.Build.0 = Release|.NET
- {95394B96-A794-48EA-9879-0E4EC79C5724}.Debug.ActiveCfg = Debug|.NET
- {95394B96-A794-48EA-9879-0E4EC79C5724}.Debug.Build.0 = Debug|.NET
- {95394B96-A794-48EA-9879-0E4EC79C5724}.Release.ActiveCfg = Release|.NET
- {95394B96-A794-48EA-9879-0E4EC79C5724}.Release.Build.0 = Release|.NET
- {6BEF566A-2691-4EE8-91AF-0390CCCDDAF1}.Debug.ActiveCfg = Debug|.NET
- {6BEF566A-2691-4EE8-91AF-0390CCCDDAF1}.Debug.Build.0 = Debug|.NET
- {6BEF566A-2691-4EE8-91AF-0390CCCDDAF1}.Release.ActiveCfg = Release|.NET
- {6BEF566A-2691-4EE8-91AF-0390CCCDDAF1}.Release.Build.0 = Release|.NET
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/Nuget/Lucene.Net.Core.2.9.4.1.nupkg
----------------------------------------------------------------------
diff --git a/lib/Nuget/Lucene.Net.Core.2.9.4.1.nupkg b/lib/Nuget/Lucene.Net.Core.2.9.4.1.nupkg
deleted file mode 100644
index 5173434..0000000
Binary files a/lib/Nuget/Lucene.Net.Core.2.9.4.1.nupkg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/StyleCop.4.5/Docs/StyleCop.chm
----------------------------------------------------------------------
diff --git a/lib/StyleCop.4.5/Docs/StyleCop.chm b/lib/StyleCop.4.5/Docs/StyleCop.chm
deleted file mode 100644
index d49473d..0000000
Binary files a/lib/StyleCop.4.5/Docs/StyleCop.chm and /dev/null differ
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/src/Lucene.Net.Codecs/Appending/AppendingCodec.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Appending/AppendingCodec.cs b/src/Lucene.Net.Codecs/Appending/AppendingCodec.cs
new file mode 100644
index 0000000..01248d6
--- /dev/null
+++ b/src/Lucene.Net.Codecs/Appending/AppendingCodec.cs
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Lucene.Net.Codecs.Appending
+{
+ using System;
+ using Lucene.Net.Codecs.Lucene40;
+
+ /// <summary>
+ /// This codec uses an index format that is very similar to Lucene40Codec
+ /// but works on append-only outputs, such as plain output streams and
+ /// append-only filesystems.
+ ///
+ /// @lucene.experimental
+ /// </summary>
+ [Obsolete(
+ "This codec is read-only: as the functionality has been folded into the default codec. Its only for convenience to read old segments."
+ )]
+ public class AppendingCodec : FilterCodec
+ {
+ private readonly PostingsFormat _postings = new AppendingPostingsFormat();
+
+ public AppendingCodec() : base("Appending", new Lucene40Codec())
+ {
+ }
+
+ public override PostingsFormat PostingsFormat()
+ {
+ return _postings;
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/src/Lucene.Net.Codecs/Appending/AppendingPostingsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Appending/AppendingPostingsFormat.cs b/src/Lucene.Net.Codecs/Appending/AppendingPostingsFormat.cs
new file mode 100644
index 0000000..8e3f770
--- /dev/null
+++ b/src/Lucene.Net.Codecs/Appending/AppendingPostingsFormat.cs
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Lucene.Net.Codecs.Appending
+{
+ using System;
+ using Lucene.Net.Codecs.Lucene40;
+ using Lucene.Net.Index;
+
+ /// <summary>
+ /// Appending Postigns Implementation
+ /// </summary>
+ internal class AppendingPostingsFormat : PostingsFormat
+ {
+ public static String CODEC_NAME = "Appending";
+
+ public AppendingPostingsFormat() : base(CODEC_NAME)
+ {}
+
+ public override FieldsConsumer FieldsConsumer(SegmentWriteState state)
+ {
+ throw new NotImplementedException("This codec can only be used for reading");
+ }
+
+ public override FieldsProducer FieldsProducer(SegmentReadState state)
+ {
+ PostingsReaderBase postings = new Lucene40PostingsReader(state.Directory, state.FieldInfos,
+ state.SegmentInfo,
+ state.Context, state.SegmentSuffix);
+
+ var success = false;
+ FieldsProducer ret;
+ using (ret = new AppendingTermsReader(
+ state.Directory,
+ state.FieldInfos,
+ state.SegmentInfo,
+ postings,
+ state.Context,
+ state.SegmentSuffix,
+ state.TermsIndexDivisor))
+ {
+ success = true;
+ }
+
+ return ret;
+
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/src/Lucene.Net.Codecs/Appending/AppendingTermsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Appending/AppendingTermsReader.cs b/src/Lucene.Net.Codecs/Appending/AppendingTermsReader.cs
new file mode 100644
index 0000000..da4e33f
--- /dev/null
+++ b/src/Lucene.Net.Codecs/Appending/AppendingTermsReader.cs
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Lucene.Net.Codecs.Appending
+{
+ using System;
+ using Lucene.Net.Index;
+ using Lucene.Net.Store;
+
+ /// <summary>
+ /// Reads append-only terms from AppendingTermsWriter.
+ ///
+ /// @lucene.experimental
+ /// </summary>
+ [Obsolete("Only for reading old Appending segments")]
+ public class AppendingTermsReader : BlockTreeTermsReader
+ {
+ private const String APPENDING_TERMS_CODEC_NAME = "APPENDING_TERMS_DICT";
+ private const String APPENDING_TERMS_INDEX_CODEC_NAME = "APPENDING_TERMS_INDEX";
+
+ public AppendingTermsReader(Directory dir, FieldInfos fieldInfos, SegmentInfo info,
+ PostingsReaderBase postingsReader,
+ IOContext ioContext, String segmentSuffix, int indexDivisor)
+ : base(dir, fieldInfos, info, postingsReader, ioContext, segmentSuffix, indexDivisor)
+ {
+ }
+
+ protected override int ReadHeader(IndexInput input)
+ {
+ return CodecUtil.CheckHeader(input, APPENDING_TERMS_CODEC_NAME,
+ BlockTreeTermsWriter.VERSION_START,
+ BlockTreeTermsWriter.VERSION_CURRENT);
+ }
+
+ protected override int ReadIndexHeader(IndexInput input)
+ {
+ return CodecUtil.CheckHeader(input, APPENDING_TERMS_INDEX_CODEC_NAME,
+ BlockTreeTermsWriter.VERSION_START,
+ BlockTreeTermsWriter.VERSION_CURRENT);
+ }
+
+ protected override void SeekDir(IndexInput input, long dirOffset)
+ {
+ input.Seek(input.Length() - sizeof(long)/8);
+ long offset = input.ReadLong();
+ input.Seek(offset);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsFieldAndTerm.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsFieldAndTerm.cs b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsFieldAndTerm.cs
new file mode 100644
index 0000000..3001bfa
--- /dev/null
+++ b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsFieldAndTerm.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Lucene.Net.Util;
+
+namespace Lucene.Net.Codecs.BlockTerms
+{
+ /// <summary>
+ /// Used as key for the terms cache
+ /// </summary>
+ internal class BlockTermsFieldAndTerm : DoubleBarrelLRUCache.CloneableKey
+ {
+
+ public String Field { get; set; }
+ public BytesRef Term { get; set; }
+
+ public FieldAndTerm()
+ {
+ }
+
+ public FieldAndTerm(FieldAndTerm other)
+ {
+ Field = other.Field;
+ Term = BytesRef.DeepCopyOf(other.Term);
+ }
+
+ public override bool Equals(Object _other)
+ {
+ FieldAndTerm other = (FieldAndTerm) _other;
+ return other.Field.equals(field) && Term.BytesEquals(other.Term);
+ }
+
+ public override FieldAndTerm Clone()
+ {
+ return new FieldAndTerm(this);
+ }
+
+ public override int GetHashCode()
+ {
+ return Field.GetHashCode()*31 + Term.GetHashCode();
+ }
+ }
+}
+