public void ShouldSendADELETEIfTheStateTransitionNameIsCancelDestroyOrDelete()
        {
            RestfulieHttpVerbDiscovery verbDiscovery = new RestfulieHttpVerbDiscovery();
            string        verbName        = verbDiscovery.GetHttpVerbByTransitionName("Cancel");
            List <string> transitionNames = new List <string>()
            {
                "Cancel", "Destroy", "Delete"
            };

            transitionNames.ForEach(transitionName =>
                                    Assert.AreEqual("DELETE", verbDiscovery.GetHttpVerbByTransitionName(transitionName))
                                    );
        }
        public void ShouldBeSendAGetForSomeTransitionNameThatIsNotSupported()
        {
            RestfulieHttpVerbDiscovery verbDiscovery = new RestfulieHttpVerbDiscovery();
            string verbName = verbDiscovery.GetHttpVerbByTransitionName("Transition Name not default");

            Assert.AreEqual("GET", verbName);
        }
        public void ShouldSendAPUTIfTheStateTransitionNameIsUpdate()
        {
            RestfulieHttpVerbDiscovery verbDiscovery = new RestfulieHttpVerbDiscovery();
            string verbName = verbDiscovery.GetHttpVerbByTransitionName("Update");

            Assert.AreEqual("PUT", verbName);
        }
        public void ShouldBeSendAGetIfTheStateTransitionNameIsRefreshReloadShowOrLatest()
        {
            RestfulieHttpVerbDiscovery verbDiscovery = new RestfulieHttpVerbDiscovery();
            List <string> transitionNames            = new List <string>()
            {
                "Refresh", "Reload", "Show", "Latest"
            };

            transitionNames.ForEach(transitionName =>
                                    Assert.AreEqual("GET", verbDiscovery.GetHttpVerbByTransitionName(transitionName)
                                                    ));
        }
Пример #5
0
 private string GetVerb(string transitionName)
 {
     return(_httpVerbDiscovery.GetHttpVerbByTransitionName(transitionName));
 }