public async Task FindOpenPositionsWorksCorrectly() { var p1 = await _underTest.OpenAsync("EUR", "USD", 200, 1.2f); var p2 = await _underTest.OpenAsync("EUR", "USD", 200, 1.2f); var p3 = await _underTest.OpenAsync("EUR", "USD", 200, 1.3f); var p4 = await _underTest.OpenAsync("EUR", "USD", 200, 1.3f); await _underTest.CloseAsync(p2, 250, 2, null); await _underTest.CloseAsync(p4, 250, 2, null); var positions = await _underTest.FindOpenPositionsAsync("EUR", "USD", 1.25f); positions.Count.Should().Be(1, "there are just two open and only one from them fits"); positions[0].Id.Should().Be(p3, "only p3 is open and opened higher"); }