示例#1
0
        public void Given_CreatedVotingPairFromDictionary_When_NullDictionary_Then_Exception()
        {
            Dictionary <string, int> values = null;
            Action result = () => VotingPair.CreateFrom(values);

            Assert.ThrowsAny <ArgumentNullException>(result);
        }
示例#2
0
        public void Given_CreatedVotingPairFromDictionary_When_OnlyTwoTopics_Then_NewVotingPair()
        {
            var result = VotingPair.CreateFrom(new Dictionary <string, int>()
            {
                { "C#", 1 },
                { "F#", 2 }
            });

            Assert.Equal(result.TopicA, ("C#", 1));
            Assert.Equal(result.TopicB, ("F#", 2));
        }
示例#3
0
        public void Given_CreatedVotingPairFromDictionary_When_MoreThanTwoTopics_Then_Empty()
        {
            var result = VotingPair.CreateFrom(new Dictionary <string, int>()
            {
                { "C#", 0 },
                { "F#", 1 },
                { "Haskell", 2 }
            });

            Assert.Equal(result.IsEmpty, true);
        }