Ejemplo n.º 1
0
        public void Correctly_Splits_By_Person()
        {
            var chats = Data.GetChatsWithDifferentPeople();
            var factory = new StreaksFactory();

            var streaks = factory.GetStreaks(new ChatCollection(chats));

            Assert.IsTrue(streaks.SequenceEqual(Data.GetCorrectlySplitStreaksFromDifferentPeople()));
        }
Ejemplo n.º 2
0
        public void Correctly_Splits_By_Date()
        {
            var chats = Data.GetChatsWithNonConsecutiveDates();
            var factory = new StreaksFactory();

            var streaks = factory.GetStreaks(new ChatCollection(chats));

            Assert.IsTrue(streaks.SequenceEqual(Data.GetCorrectlySplitStreaksFromNonConsecutiveDates()));
        }
Ejemplo n.º 3
0
        public void Correctly_Handles_Chats_With_Same_Date()
        {
            var chats = Data.GetChatsWithSameDates();
            var factory = new StreaksFactory();

            var streaks = factory.GetStreaks(new ChatCollection(chats));
            var expected = Data.GetCorrectStreakFromChatsWithSameDates();

            Assert.AreEqual(streaks.Count(), 1);
            Assert.AreEqual(expected, streaks.First());
        }
Ejemplo n.º 4
0
        public void Correctly_Groups_By_Consecutive_Dates()
        {
            var chats = Data.GetChatsWithConsecutiveDates();
            var factory = new StreaksFactory();

            var streaks = factory.GetStreaks(new ChatCollection(chats));

            Assert.AreEqual(streaks.Count(), 1);
            Assert.AreEqual(streaks.First().ChatCollection, new ChatCollection(chats));
            Assert.IsTrue(streaks.First().ChatsByDay.All(collection => collection.Count() == 1));
        }