コード例 #1
0
        public void TotalDays_one_entry_is_1()
        {
            var entityUnderTest = new DreamTagStatistics(new List <DreamEntry>
            {
                GetDreamOn(new DateTime(2019, 3, 1))
            });

            entityUnderTest.TotalDays.Should().Be(1);
        }
コード例 #2
0
        public void TotalEntries_three_entries_is_3()
        {
            var entityUnderTest = new DreamTagStatistics(new List <DreamEntry>
            {
                GetDreamOn(new DateTime(2019, 3, 1)),
                GetDreamOn(new DateTime(2019, 3, 2)),
                GetDreamOn(new DateTime(2019, 3, 1))
            });

            entityUnderTest.TotalEntries.Should().Be(3);
        }
コード例 #3
0
        public void Statistics_calculated_properly()
        {
            var entityUnderTest = new DreamTagStatistics(new List <DreamEntry>
            {
                GetDreamOn(new DateTime(2019, 3, 1), "Friend (John), Car"),
                GetDreamOn(new DateTime(2019, 3, 2), "Friend (Pepe, John), Beach"),
                GetDreamOn(new DateTime(2019, 3, 1), "Car, Friend (Alfredo)")
            });
            var friendStat = entityUnderTest.TagStatistics.Single(x => x.Tag == "Friend");

            friendStat.TagCount.Should().Be(3);
            friendStat.ChildStatTags.Should().ContainSingle(x => x.Tag == "John" && x.TagCount == 2);
            friendStat.ChildStatTags.Should().ContainSingle(x => x.Tag == "Pepe" && x.TagCount == 1);
            friendStat.ChildStatTags.Should().ContainSingle(x => x.Tag == "Alfredo" && x.TagCount == 1);

            entityUnderTest.TagStatistics.Single(x => x.Tag == "Car").TagCount.Should().Be(2);
            entityUnderTest.TagStatistics.Single(x => x.Tag == "Beach").TagCount.Should().Be(1);
        }
コード例 #4
0
        public void TotalEntries_empty_list_is_0()
        {
            var entityUnderTest = new DreamTagStatistics(new List <DreamEntry>());

            entityUnderTest.TotalEntries.Should().Be(0);
        }
コード例 #5
0
        public void TotalDays_with_empty_collection_is_0()
        {
            var entityUnderTest = new DreamTagStatistics(new List <DreamEntry>());

            entityUnderTest.TotalDays.Should().Be(0);
        }