root/src/FmwkPoiesis.ObjectSearch.Test/GeneralTest.cs
| 1 | 4 | ||
|---|---|---|---|
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using FmwkPoiesis.ObjectSearchProvider.Hql; |
3 | using System.Linq; | 3 | using FmwkPoiesis.ObjectSearchProvider.Linq; |
4 | using System.Text; | 4 | using Microsoft.Practices.ServiceLocation; |
5 | |||
6 | using NUnit.Framework; | 5 | using NUnit.Framework; |
7 | 6 | ||
8 | using MDS.Simpatia.Model.ObjectSearch; | 7 | using MDS.Simpatia.Model.ObjectSearch; |
8 | using Poiesis.FrameWork.ObjectSearch; | ||
9 | using Ushuaia.WebUI; | ||
9 | 10 | ||
10 | namespace FmwkPoiesis.ObjectSearch.Test | 11 | namespace FmwkPoiesis.ObjectSearch.Test |
11 | { | 12 | { |
... | ... | ||
14 | { | 15 | { |
15 | SearchPersona sp; | 16 | SearchPersona sp; |
16 | 17 | ||
18 | private static IAppInitializer initializer; | ||
19 | |||
17 | [TestFixtureSetUp] | 20 | [TestFixtureSetUp] |
18 | public void Setup() | 21 | public void Setup() |
19 | { | 22 | { |
23 | //initializer = new CastleNHAppInitializer(); | ||
24 | //initializer.Startup(); | ||
25 | |||
26 | //Poiesis.FrameWork.ObjectSearch.ObjectSearch.DefaultProvider = ServiceLocator.Current.GetInstance<IObjectSearchProvider>(); | ||
27 | |||
28 | Poiesis.FrameWork.ObjectSearch.ObjectSearch.DefaultProvider = new LinqObjectSearchProvider(); | ||
29 | |||
20 | sp = new SearchPersona(); | 30 | sp = new SearchPersona(); |
21 | sp.Apellido.ValueToCompare = "Borges"; | 31 | sp.Apellido.ValueToCompare = "Borges"; |
22 | sp.Nombre.ValueToCompare = "Jorge Luis"; | 32 | sp.Nombre.ValueToCompare = "Jorge Luis"; |
... | ... | ||
27 | [Test] | 37 | [Test] |
28 | public void TestBuildCommand() | 38 | public void TestBuildCommand() |
29 | { | 39 | { |
30 | string outPut = sp.BuildCommandSearch(); | 40 | string outPut = "Generando para " + Poiesis.FrameWork.ObjectSearch.ObjectSearch.DefaultProvider.Name; |
31 | Console.WriteLine(outPut); | 41 | Console.WriteLine(outPut); |
42 | outPut = sp.BuildCommandSearch(); | ||
43 | Console.WriteLine(outPut); | ||
44 | |||
45 | var providerHql = new HqlObjectSearchProvider(); | ||
46 | string outPut2 = "Generando para " + providerHql.Name ; | ||
47 | Console.WriteLine(outPut2); | ||
48 | outPut2 = sp.BuildCommandSearch(); | ||
49 | Console.WriteLine(outPut2); | ||
32 | } | 50 | } |
33 | } | 51 | } |
34 | } | 52 | } |
Download diff