Example #1
0
        public void Handler_has_guy_proxy()
        {
            var mock = new RestifyGuysMock();

            var target = new HandleGuys(mock.GetObject());

            Assert.IsNotNull(target.RestifyGuysProxy);
        }
Example #2
0
        public void Guy_has_badness()
        {
            var guy = new Guy();

            var mock = new RestifyGuysMock();

            mock.Guys.Add(guy);

            var target = new HandleGuys(mock.GetObject());

            var actual = target.GetGuy(guy.Id);

            Assert.IsTrue(actual.Badness > 0);
        }
Example #3
0
        public void HandleGuys_get_politicians()
        {
            var guy = new Guy(5, 5);

            var mock = new RestifyGuysMock();

            mock.Guys.Add(guy);

            var target = new HandleGuys(mock.GetObject());

            var politicians = target.GetPoliticians();

            Assert.IsNotNull(politicians);
            Assert.IsTrue(politicians.Any());
        }
Example #4
0
        public void HandleGuys_does_good_deed_and_updates_guy()
        {
            var guy = new Guy(5, 1);

            var mock = new RestifyGuysMock();

            mock.Guys.Add(guy);

            var target = new HandleGuys(mock.GetObject());

            target.GuyDoesGoodDeed(guy.Id);

            var actual = mock.Guys.FirstOrDefault();

            Assert.IsNotNull(actual);
            Assert.AreEqual(6, actual.Goodness);
        }