public void GetProfileTest1() { Global.TOKEN = ""; Exception exception = null; var container = UnityContainerSuppor.BuildUnityContainer(); var instance = container.Resolve <InstagramBussinessImpl>(); EndpointImpl endpoint = new EndpointImpl(instance); Profile profile = null; Task.Run(async() => { try { profile = await endpoint.GetProfile(); } catch (Exception ex) { exception = ex; } }).GetAwaiter().GetResult(); Assert.IsNull(profile); Assert.IsNotNull(exception); Assert.AreEqual(exception.Message, "Missing client_id or access_token URL parameter."); }
public void GetProfileTest() { Global.TOKEN = "39217616.abb738d.964d271718624e29a213d5b8d602ccf7"; var container = UnityContainerSuppor.BuildUnityContainer(); var instance = container.Resolve <InstagramBussinessImpl>(); EndpointImpl endpoint = new EndpointImpl(instance); Profile profile = null; Task.Run(async() => { profile = await endpoint.GetProfile(); }).GetAwaiter().GetResult(); Assert.IsNotNull(profile); Assert.AreEqual(profile.full_name, "Anh Nguyen"); }