Exemplo n.º 1
0
        public void GivenGetThePassStatus()
        {
            var guid = (string)ScenarioContext.Current["guid"];

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

            ScenarioContext.Current["lastCode"] = (int)response.Result.StatusCode;
        }
Exemplo n.º 2
0
        public void GivenDeleteThePassByGuid()
        {
            var guid = (string)ScenarioContext.Current["guid"];

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

            ScenarioContext.Current["lastCode"] = (int)response.Result.StatusCode;
        }
Exemplo n.º 3
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.º 4
0
        public void GivenUpdatePassWithRandomInfo()
        {
            var newPass = new MvcPass
            {
                Guid = (string)ScenarioContext.Current["guid"]
            };

            var response = MvcBaseUtils.Request("put", MvcBaseUtils.Pass, MvcPass.ToJson(newPass));

            ScenarioContext.Current["pass"]     = newPass;
            ScenarioContext.Current["lastCode"] = (int)response.Result.StatusCode;
        }
Exemplo n.º 5
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));
            }
        }