Example #1
0
        public ServiceUnavailableMockModule(ICounter counter)
        {
            Post(BasePath + "first", x => {
                counter.Bump(1);
                if (counter.Count(1) > 1)
                {
                    return(success("first"));
                }
                else
                {
                    return(serviceUnavailable());
                }
            });

            Post(BasePath + "second", x => {
                counter.Bump(2);
                if (counter.Count(2) > 2)
                {
                    return(success("second"));
                }
                else
                {
                    return(serviceUnavailable());
                }
            });

            Post(BasePath + "third", x => {
                counter.Bump(3);
                if (counter.Count(3) > 3)
                {
                    return(success("third"));
                }
                else
                {
                    return(serviceUnavailable());
                }
            });
        }