Exemplo n.º 1
0
        public void GivenAddPassWithRandomPerson()
        {
            var pass = new MvcPass();

            var response = MvcBaseUtils.Request("post", MvcBaseUtils.Pass, MvcPass.ToJson(pass));

            ScenarioContext.Current["guid"]     = MvcBaseUtils.Deserialize <string>(response);
            ScenarioContext.Current["pass"]     = pass;
            ScenarioContext.Current["lastCode"] = (int)response.Result.StatusCode;
        }
Exemplo n.º 2
0
        public void GivenGetByGuidAndAssertReturnCodeIs(int expectedCode)
        {
            var guid = (string)ScenarioContext.Current["guid"];

            var response = MvcBaseUtils.Request("get", MvcBaseUtils.Pass + guid);

            Assert.AreEqual(expectedCode, (int)response.Result.StatusCode, "Только что созданный пропуск не найден");

            MvcPass passAct = MvcBaseUtils.Deserialize <MvcPass>(response);

            if (ScenarioContext.Current.ContainsKey("pass"))
            {
                MvcPass passExp = (MvcPass)ScenarioContext.Current["pass"];
                passAct.Should().BeEquivalentTo(passExp, options => options.WithoutStrictOrdering().Excluding(o => o.Guid));
            }
        }