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); }
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); }
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); }
public static WorkflowPacket Login(this WorkflowPacket wp, string username = "******", string password = "******") { string token = null; wp .Post <LoginResponse>("account/login", new { username, password }) .AndOk() .Then(wp => token = wp.GetObject <LoginResponse>().AccessToken) .UseHeader("Authorization", $"Bearer {token}"); return(wp); }