Exemple #1
0
        public static WorkflowPacket Break(this WorkflowPacket wp)
        {
            wp.Log("Break");
            Debugger.Break();

            return(wp);
        }
Exemple #2
0
        public static WorkflowPacket IShouldSee(this WorkflowPacket wp, Action test)
        {
            wp.Log($"IShouldSee");
            test();

            return(wp);
        }
Exemple #3
0
        public static WorkflowPacket Then(this WorkflowPacket wp, Action <WorkflowPacket> action)
        {
            wp.Log($"Then");
            action(wp);

            return(wp);
        }
Exemple #4
0
        public static WorkflowPacket AndInternalServerError(this WorkflowPacket wp)
        {
            wp.Log("AndInternalServerError");
            wp.LogInternalServerError();
            wp.LastResponse.Should().Be(HttpStatusCode.InternalServerError);

            return(wp);
        }
Exemple #5
0
        public static WorkflowPacket IShouldSee(this WorkflowPacket wp, Func <bool> test)
        {
            wp.Log($"IShouldSee");
            bool b = test();

            b.Should().BeTrue();

            return(wp);
        }
Exemple #6
0
        public static WorkflowPacket IShouldSee <T>(this WorkflowPacket wp, string containerName, Action <T> test) where T : class
        {
            wp.Log($"IShouldSee {typeof(T).Name} {containerName}");
            T obj = wp.GetObject <T>(containerName);

            test(obj);

            return(wp);
        }
Exemple #7
0
        public static WorkflowPacket LogInternalServerError(this WorkflowPacket wp)
        {
            if (wp.LastResponse == HttpStatusCode.InternalServerError)
            {
                wp.Log(wp.LastContent);
            }

            return(wp);
        }
Exemple #8
0
        public static WorkflowPacket IGet <T>(this WorkflowPacket wp, string containerName, Action <T> getter) where T : class
        {
            wp.Log($"IGet {typeof(T).Name} {containerName}");
            T obj = wp.GetObject <T>(containerName);

            getter(obj);

            return(wp);
        }
Exemple #9
0
        public static WorkflowPacket IShouldSee(this WorkflowPacket wp, string containerName, Func <dynamic, bool> test)
        {
            wp.Log($"IShouldSee {containerName}");
            var  obj = wp.GetObject(containerName);
            bool b   = test(obj);

            b.Should().BeTrue();

            return(wp);
        }
Exemple #10
0
        public static WorkflowPacket Delete(this WorkflowPacket wp, string route)
        {
            wp.Log($"DELETE: {route}");
            var resp = RestService.Delete($"{wp.BaseUrl}/{route}", wp.Headers);

            wp.LastResponse = resp.status;
            wp.LastContent  = resp.content;

            return(wp);
        }
Exemple #11
0
        public static WorkflowPacket Patch(this WorkflowPacket wp, string route, object data)
        {
            wp.Log($"PATCH: {route}");
            var resp = RestService.Patch($"{wp.BaseUrl}/{route}", data, wp.Headers);

            wp.LastResponse = resp.status;
            wp.LastContent  = resp.content;

            return(wp);
        }
Exemple #12
0
        public static WorkflowPacket Patch <T>(this WorkflowPacket wp, string name, string route, object data) where T : new()
        {
            wp.Log($"PATCH: {typeof(T).Name} {route}");
            var resp = RestService.Patch <T>($"{wp.BaseUrl}/{route}", data, wp.Headers);

            wp.LastResponse = resp.status;
            wp.LastContent  = resp.content;
            wp.SetObject(name, resp.item);

            return(wp);
        }
Exemple #13
0
 public static WorkflowPacket IShouldSee <T>(this WorkflowPacket wp, Action <T> test) where T : class
 {
     wp.Log($"IShouldSee {typeof(T).Name}");
     return(wp.IShouldSee(typeof(T).Name, test));
 }