Exemplo n.º 1
0
        public void Contains_Test()
        {
            var colorBalls = RepositoryFactory.GetBalls();
            var luckyBall  = new ColorBall()
            {
                Color = Color.Purple, Size = "S", Prize = 500
            };

            Assert.IsTrue(colorBalls.EltonContains(luckyBall, new ColorBallComparer()));
        }
Exemplo n.º 2
0
        public void find_last_size_is_s_ball_test()
        {
            var colorBalls = RepositoryFactory.GetBalls();
            var actul      = colorBalls.ChloeLast(current => current.Size == "S");
            var expect     = new ColorBall {
                Color = Color.Purple, Size = "S", Prize = 500
            };

            expect.ToExpectedObject().ShouldEqual(actul);
        }
Exemplo n.º 3
0
        public void contains_special_ball_purple_test()
        {
            var colorBalls = RepositoryFactory.GetBalls();
            var colorBall  = new ColorBall {
                Color = Color.Purple, Prize = 500
            };
            var actul = YourOwnLinq.IsSameBall(colorBalls, colorBall, new ChloeBallCompare());

            Assert.IsTrue(actul);
        }
Exemplo n.º 4
0
        public void is_single_test()
        {
            var colorBalls = RepositoryFactory.GetBalls();
            var act        = colorBalls.IsSingle(ball => ball.Size == "M");
            var expect     = new ColorBall {
                Color = Color.Yellow, Size = "M", Prize = 500
            };

            expect.ToExpectedObject().ShouldEqual(act);
        }
Exemplo n.º 5
0
 public static bool IsSameBall(IEnumerable <ColorBall> colorBalls, ColorBall colorBall, ChloeBallCompare chloeBallCompare)
 {
     foreach (var ball in colorBalls)
     {
         if (chloeBallCompare.Equals(ball, colorBall))
         {
             return(true);
         }
     }
     return(false);
 }