Beispiel #1
0
 public void TestHitsCache()
 {
     var client = new ElasticClient(new ConnectionSettings(new Uri("http://localhost:9200")));
     var expected = 12m;
     var id = client.GetIdFor(new DecimalIdClass { Id = expected });
     id = client.GetIdFor(new DecimalIdClass { Id = expected });
     StringAssert.AreEqualIgnoringCase(expected.ToString(), id);
 }
Beispiel #2
0
 public void TestCustomLookup()
 {
     var client = new ElasticClient(new ConnectionSettings(new Uri("http://localhost:9200")));
     var expected = new MyCustomClass();
     var id = client.GetIdFor(new CustomObjectIdClass { Id = expected });
     StringAssert.AreEqualIgnoringCase(expected.ToString(), id);
 }
Beispiel #3
0
 public void TestAlternateIdLookup()
 {
     var client = new ElasticClient(new ConnectionSettings(new Uri("http://localhost:9200")));
     var expectedGuid = Guid.NewGuid();
     var id = client.GetIdFor(new AlternateIdClass { Guid = expectedGuid });
     StringAssert.AreEqualIgnoringCase(expectedGuid.ToString(), id);
 }