示例#1
0
        public static IContentLoader <T> CreateFakeFailLoader <T>()
        {
            IContentLoader <T> creation = A.Fake <IContentLoader <T> >();

            A.CallTo(() => creation.LoadAsync(A <string> .Ignored))
            .Returns(Task.FromResult(new WebResponse <T>("This is a simulated fail", 404)));
            return(creation);
        }
示例#2
0
        public static IContentLoader <T> CreateFakeLoader <T>(T content)
        {
            IContentLoader <T> creation = A.Fake <IContentLoader <T> >();

            A.CallTo(() => creation.LoadAsync(A <string> .Ignored))
            .Returns(Task.FromResult(new WebResponse <T>(content, null, 200)));
            return(creation);
        }
 private void LoadCollectionFromRemote(string url)
 {
     m_loader = new CollectionContentLoader();
     m_loader.LoadCompleted += OnLoadCollectionCompleted;
     m_loader.LoadAsync(new LoadContext()
     {
         Url = url
     });
 }
 private void LoadCollectionFromRemote(string url)
 {
     m_loader = new CollectionContentLoader();
     m_loader.LoadCompleted += OnLoadCollectionCompleted;
     m_loader.LoadAsync(new LoadContext() { Url = url });
 }