public void bbb(string broker, bool expected) { // Arrange var spec = new BrokerSpecification("MS", "DB", "GS").And(new BrokerSpecification("MS")); var position = new Position(broker, "1"); // Act var result = spec.IsSatisfiedBy(position); // Assert Assert.Equal(expected, result); }
public void ccc() { var list = new List <IPosition> { new Position("MS", "1"), new Position("DB", "2"), new Position("GS", "3"), new Position("BA", "4") }; var brokerSpec = new BrokerSpecification("MS").Or(new BrokerSpecification("GS")); var result = list.Where(a => brokerSpec.IsSatisfiedBy(a)).ToList(); var result2 = list.Where(brokerSpec.ToExpression().Compile()).ToList(); }