コード例 #1
0
        public void GetFromImdbWhenPathButEntryDoesNotExistImplicit()
        {
            SimulationManager mgr = new SimulationManager();
            var post = SimulationFactory.When.I.Post().ToImdb("/Pet").AsJson().And.NotExists("Kind").Then.AddToImdb();
            mgr.Add(post.Simulation);

            var get = SimulationFactory.When.I.Get().FromImdb("/Pet('{Kind}')").AsJson().Then.Return.StatusCode(System.Net.HttpStatusCode.OK);
            mgr.Add(get.Simulation);

            mgr.AddToImdb(post.Simulation, "/Pet", "/Pet", @"{ ""Kind"" : ""Cat"" }", null);

            var match = mgr.GetFromImdb(HttpMethod.Get, "/Pet('Dog')", "", new List<Header>(), null);
            Assert.IsNull(match);
        }
コード例 #2
0
        public void GetFromImdbWhenPathButDoesNotMatchPattern()
        {
            SimulationManager mgr = new SimulationManager();
            var get = SimulationFactory.When.I.Get().FromImdb("/Pet('{Kind}')").AsJson().Then.Return.StatusCode(System.Net.HttpStatusCode.OK);
            mgr.Add(get.Simulation);

            var match = mgr.GetFromImdb(HttpMethod.Get, "/Pet(Dog)", "", new List<Header>(), null);
            Assert.IsNull(match);
        }