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); }
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(); }); }
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(); }); }
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); }