public void IndexOfEmptyList()
        {
            var list = new TransactionListTestClass();

            var result = list.IndexOf(new Date(2000, 01, 01), TransationListPosition.First);

            result.Should().Be(~0);
        }
        public void IndexOfBetweenTwoDates()
        {
            var list = new TransactionListTestClass();

            list.Add(Guid.NewGuid(), new Date(2000, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2001, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2001, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2002, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2003, 01, 01));

            var result = list.IndexOf(new Date(2001, 06, 01), TransationListPosition.First);

            result.Should().Be(~3);
        }
        public void IndexOfBeforeFirstEntry()
        {
            var list = new TransactionListTestClass();

            list.Add(Guid.NewGuid(), new Date(2000, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2001, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2001, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2002, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2003, 01, 01));

            var result = list.IndexOf(new Date(1999, 01, 01), TransationListPosition.First);

            result.Should().Be(~0);
        }
        public void IndexOfAfterLastEntry()
        {
            var list = new TransactionListTestClass();

            list.Add(Guid.NewGuid(), new Date(2000, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2001, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2001, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2001, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2002, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2003, 01, 01));

            var result = list.IndexOf(new Date(2004, 01, 01), TransationListPosition.Last);

            result.Should().Be(~6);
        }
        public void IndexOfMatchingMultipeDatesToGetLastEntry()
        {
            var list = new TransactionListTestClass();

            list.Add(Guid.NewGuid(), new Date(2000, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2001, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2001, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2001, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2002, 01, 01));
            list.Add(Guid.NewGuid(), new Date(2003, 01, 01));

            var result = list.IndexOf(new Date(2001, 01, 01), TransationListPosition.Last);

            result.Should().Be(3);
        }