public void AggregateTermRowConstructorSetsProperties() { var actual = new AggregateTermRow(ExpectedKey, expectedFields); Assert.Same(ExpectedKey, actual.Key); Assert.Equal(expectedFields.ToArray(), actual.Fields); }
public void AggregateTermRowGetValueDefaultsIntValue() { var row = new AggregateTermRow(ExpectedKey, expectedFields); var actual = row.GetValue("missing", "int", typeof(int)); Assert.Equal(default(int), actual); }
public void AggregateRowGetKeyReturnsKeyForTermRow() { var row = new AggregateTermRow("rowKey", new[] { new AggregateField("field1", "eq", new JObject()) }); var key = AggregateRow.GetKey(row); Assert.Equal(row.Key, key); }
public void AggregateTermRowGetValueParsesIntValue() { var expected = expectedFields[1]; var row = new AggregateTermRow(ExpectedKey, expectedFields); var actual = row.GetValue(expected.Name, expected.Operation, typeof(int)); Assert.Equal(5, actual); }
public void AggregateTermRowGetValueParsesStringValue() { var expected = expectedFields[0]; var row = new AggregateTermRow(ExpectedKey, expectedFields); var actual = row.GetValue(expected.Name, expected.Operation, typeof(string)); Assert.Equal("mower", actual); }
public void AggregateRowGetValueReturnsValueForTermRow() { var expectedName = "aField"; var expectedOperation = "count"; var expectedValue = "aValue"; var row = new AggregateTermRow("rowKey", new[] { new AggregateField(expectedName, expectedOperation, new JValue(expectedValue)) }); var actual = AggregateRow.GetValue(row, expectedName, expectedOperation, expectedValue.GetType()); Assert.Equal(expectedValue, actual); }