public void Boost_AddsFieldIfValid(byte weight, bool shouldAdd) { var result = _service.Boost(x => x.StringProperty, weight) as ElasticSearchService <ComplexType>; bool added = result.BoostFields.Any(x => x.Value == weight); Assert.Equal(added, shouldAdd); }