Beispiel #1
0
        public void GetSchema()
        {
            var basicServer = new MSolrBasicOperations <TestDocument>();

            basicServer.getSchema += () => new SolrSchema {
                UniqueKey = "bla"
            };
            var s = new SolrServer <TestDocument>(basicServer, null, null);
            var r = s.GetSchema();

            Assert.Equal("bla", r.UniqueKey);
        }
Beispiel #2
0
 public void GetSchema()
 {
     var mocks = new MockRepository();
     var basicServer = mocks.StrictMock<ISolrBasicOperations<TestDocument>>();
     var mapper = mocks.StrictMock<IReadOnlyMappingManager>();
     var validationManager = mocks.StrictMock<IMappingValidator>();
     With.Mocks(mocks)
         .Expecting(() => Expect.Call(basicServer.GetSchema())
             .Repeat.Once()
             .Return(new SolrSchema()))
         .Verify(() => {
             var s = new SolrServer<TestDocument>(basicServer, mapper, validationManager);
             s.GetSchema();
         });
 }
Beispiel #3
0
        public void GetSchema()
        {
            var mocks             = new MockRepository();
            var basicServer       = mocks.StrictMock <ISolrBasicOperations <TestDocument> >();
            var mapper            = mocks.StrictMock <IReadOnlyMappingManager>();
            var validationManager = mocks.StrictMock <IMappingValidator>();

            With.Mocks(mocks)
            .Expecting(() => Expect.Call(basicServer.GetSchema())
                       .Repeat.Once()
                       .Return(new SolrSchema()))
            .Verify(() =>
            {
                var s = new SolrServer <TestDocument>(basicServer, mapper, validationManager);
                s.GetSchema();
            });
        }
Beispiel #4
0
 public void GetSchema() {
     var basicServer = new MSolrBasicOperations<TestDocument>();
     basicServer.getSchema += () => new SolrSchema {UniqueKey = "bla"};            
     var s = new SolrServer<TestDocument>(basicServer, null, null);
     var r = s.GetSchema();
     Assert.AreEqual("bla", r.UniqueKey);
 }