public ReportWindow(Land land, Earthwatcher earthwatcher) { InitializeComponent(); commentRequests = new CommentRequests(Constants.BaseApiUrl); collectionRequests = new CollectionRequests(Constants.BaseApiUrl); landRequests = new LandRequests(Constants.BaseApiUrl); hexagonLayer = (HexagonLayer)Current.Instance.LayerHelper.FindLayer(Constants.Hexagonlayername); bcLayer = (BasecampLayer)Current.Instance.LayerHelper.FindLayer(Constants.BasecampsLayer); //TEST //Add event listeners commentRequests.CommentsByLandReceived += CommentRequestCommentsByLandReceived; collectionRequests.NewItemReceived += collectionRequests_NewItemReceived; collectionRequests.ItemsCountReceived += collectionRequests_ItemsCountReceived; collectionRequests.GetTotalItems(Current.Instance.Earthwatcher.Id); Current.Instance.MapControl.zoomFinished += MapControlZoomFinished; Current.Instance.MapControl.zoomStarted += MapControlZoomStarted; landRequests = new LandRequests(Constants.BaseApiUrl); landRequests.StatusChanged += SetLandStatusStatusChanged; landRequests.ConfirmationAdded += landRequests_ConfirmationAdded; hexagonLayer = (HexagonLayer)Current.Instance.LayerHelper.FindLayer(Constants.Hexagonlayername); this.Loaded += ReportWindow_Loaded; this.ShareStoryBoard.Completed += ShareStoryBoard_Completed; }
public CommentScreen(int landId, ObservableCollection <Earthwatchers.Models.Comment> comments) { if (comments == null) { return; } InitializeComponent(); commentRequests = new CommentRequests(Constants.BaseApiUrl); this.landId = landId; this.comments = comments; KeyDown += CommentScreenKeyDown; LoadComments(); }
public void Get_First_Post_Comments() { // arrange var provider = new HttpProvider(); const string postId = "1"; // act var listByCommentsRequest = provider.ExecuteApiMethod <List <Comment> >(CommentRequests.Get(postId)); var listByPostsRequest = provider.ExecuteApiMethod <List <Comment> >(PostRequests.GetComments(postId)); var firstNotSecond = listByCommentsRequest.Except(listByPostsRequest).ToList(); var secondNotFirst = listByPostsRequest.Except(listByCommentsRequest).ToList(); // assert Assert.IsFalse(!firstNotSecond.Any() && !secondNotFirst.Any()); //compare lists. It should be equals }
public HexagonInfo() { InitializeComponent(); earthwatcherRequest = new EarthwatcherRequests(Constants.BaseApiUrl); commentRequests = new CommentRequests(Constants.BaseApiUrl); landRequests = new LandRequests(Constants.BaseApiUrl); hexagonLayer = (HexagonLayer)Current.Instance.LayerHelper.FindLayer(Constants.Hexagonlayername); //Add event listeners commentRequests.CommentsByLandReceived += CommentRequestCommentsByLandReceived; earthwatcherRequest.EarthwatcherReceived += EarthwatcherChanged; Current.Instance.MapControl.zoomFinished += MapControlZoomFinished; Current.Instance.MapControl.zoomStarted += MapControlZoomStarted; HtmlPage.RegisterScriptableObject("HexagonInfo", this); }