Exemplo n.º 1
0
        public void SearchUserTest()
        {
            Global.TOKEN = "39217616.abb738d.964d271718624e29a213d5b8d602ccf7";
            var            container   = UnityContainerSuppor.BuildUnityContainer();
            var            instance    = container.Resolve <InstagramBussinessImpl>();
            EndpointImpl   endpoint    = new EndpointImpl(instance);
            List <Profile> listProfile = null;

            Task.Run(async() =>
            {
                listProfile = await endpoint.SearchUser("anh");
            }).GetAwaiter().GetResult();

            Assert.IsTrue(listProfile.Count > 0);
        }
Exemplo n.º 2
0
        public void SearchUserTest1()
        {
            Global.TOKEN = "";
            var            container   = UnityContainerSuppor.BuildUnityContainer();
            var            instance    = container.Resolve <InstagramBussinessImpl>();
            EndpointImpl   endpoint    = new EndpointImpl(instance);
            Exception      exception   = null;
            List <Profile> listProfile = null;

            Task.Run(async() =>
            {
                try
                {
                    listProfile = await endpoint.SearchUser("anh");
                }
                catch (Exception ex)
                {
                    exception = ex;
                }
            }).GetAwaiter().GetResult();

            Assert.IsNull(listProfile);
            Assert.IsNotNull(exception);
        }