Beispiel #1
0
        public void GetAllEntriesFromHash_ReturnsExpectedResults()
        {
            // GIVEN
            const string key  = "key-1";
            var          hash = new Hash
            {
                Id     = key,
                Hashes = new Dictionary <string, string>
                {
                    { "hash-1", "value-1" },
                    { "hash-2", "value-2" },
                    { "hash-3", "value-3" },
                }
            };

            _elasticClient.Index(hash, desc => desc.Refresh(Refresh.True)).ThrowIfInvalid();

            // WHEN
            var actualHashes = _elasticConnection.GetAllEntriesFromHash(key);

            // THEN
            actualHashes.ShouldBeEquivalentTo(hash.Hashes);
        }
 public void GetAllEntriesFromHash_Throws()
 {
     // GIVEN WHEN THEN
     Assert.Throws <HangfireElasticSearchException>(() => _elasticConnection.GetAllEntriesFromHash("key"));
 }