public NewsControl()
        {
            InitializeComponent();

            NewsSecService = new NewsSecureServiceClient();
            NewsService = new NewsServiceClient();
        }
        //
        // GET: /Home/
        public ActionResult Index()
        {
            using (var client = new NewsServiceClient())
            {
                var timer = new Stopwatch();
                timer.Start();

                var worldNews = client.GetWorldNews();
                var sportNews = client.GetSportNews();
                var funNews   = client.GetFunNews();

                var result = worldNews
                             .Union(sportNews)
                             .Union(funNews)
                             .Convert();

                timer.Stop();

                var model = new ViewModel
                {
                    News = result, Elapsed = timer.Elapsed
                };

                return(View(model));
            }
        }
Exemplo n.º 3
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            NewsServiceClient newsSvc      = new NewsServiceClient();
            string            searchOption = searchBox.Text;
            var listOfStrings = new List <AdminClientApp.NewsSVC.New>();

            AdminClientApp.NewsSVC.New[] newsArr = listOfStrings.ToArray();
            if (rbtnTenNews.Checked == true)
            {
                newsArr = newsSvc.GetTenNews(searchOption);
            }
            if (rtbnSimilar.Checked == true)
            {
                newsArr = newsSvc.GetSimilarNews(searchOption);
            }
            if (rtbnPositive.Checked == true)
            {
                newsArr = newsSvc.GetNBestPossitive(searchOption);
            }
            if (rtbnNegative.Checked == true)
            {
                newsArr = newsSvc.GetNBestNegative(searchOption);
            }
            LV1.DataSource = newsArr;
            LV1.DataBind();
        }
Exemplo n.º 4
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            lbConnecting.Visible = true;
            try
            {
                LibNews addingNews = new LibNews();
                addingNews.Title       = tbTitle.Text;
                addingNews.ReleaseDate = DateTime.Now;
                addingNews.TextContent = tbTextContent.Text;
                string restaurantName = cbRestaurantAdd.Text;

                var NSC = new NewsServiceClient("BasicHttpBinding_INewsService",
                                                $"http://{wcfServerIp}/INewService");
                NSC.CreateNewWithCatAndRest(addingNews, new string[] { cbCategory.Text }, restaurantName, null);
                cbRestaurantAdd.Text = "";
                cbCategory.Text      = "";
                tbTitle.Text         = "";
                tbTextContent.Text   = "";
            }
            catch (Exception)
            {
                MessageBox.Show("News server is not connected right now");
            }
            finally
            {
                lbConnecting.Visible = false;
            }
        }
        public Task <ViewResult> Index()
        {
            return(Task <ViewResult> .Factory.StartNew(() =>
            {
                using (var client = new NewsServiceClient())
                {
                    var timer = new Stopwatch();
                    timer.Start();

                    var worldNews = client.GetWorldNews();
                    var sportNews = client.GetSportNews();
                    var funNews = client.GetFunNews();

                    var result = worldNews
                                 .Union(sportNews)
                                 .Union(funNews)
                                 .Convert();

                    timer.Stop();

                    var model = new ViewModel {
                        News = result, Elapsed = timer.Elapsed
                    };

                    return View(model);
                }
            }));
        }
Exemplo n.º 6
0
        private void btHideShow_Click(object sender, EventArgs e)
        {
            if (btHideShow.Text == "Create news")
            {
                lbConnecting.Visible = true;
                try
                {
                    var NSC = new NewsServiceClient("BasicHttpBinding_INewsService",
                                                    $"http://{wcfServerIp}/INewService");
                    NSC.Test();

                    panelNews.Visible    = !panelNews.Visible;
                    panelNewNews.Visible = !panelNewNews.Visible;
                    btHideShow.Text      = "Watch news";
                }
                catch (Exception)
                {
                    MessageBox.Show("News server is not connected");
                }
                finally
                {
                    lbConnecting.Visible = false;
                }
            }
            else
            {
                btHideShow.Text      = "Create news";
                panelNews.Visible    = !panelNews.Visible;
                panelNewNews.Visible = !panelNewNews.Visible;
            }
        }
Exemplo n.º 7
0
        public ActionResult addNews(string title, string description, string tag, HttpPostedFileBase file, string city)
        {
            if (!isLogin())
            {
                return(RedirectToAction("Login", "Author"));
            }
            NewsServiceClient ins = new NewsServiceClient();
            News n = new News();

            //Author a = ins.getAuthor((int)Session["authorid"]);
            n.title       = title;
            n.description = description;
            n.tag         = tag;
            n.newsCity    = city;
            System.Diagnostics.Debug.WriteLine("ok rokad" + (int)Session["authorid"]);
            Author a = new Author();

            a.authorId = (int)Session["authorid"];
            n.author   = a;
            if (file != null)
            {
                n.image = file.FileName;
                var fileBytes = new byte[file.ContentLength];
                file.InputStream.Read(fileBytes, 0, fileBytes.Length);
                n.imagedata = fileBytes;
            }
            else
            {
                n.image     = null;
                n.imagedata = null;
            }
            int newsid = ins.addNews(n);

            return(RedirectToAction("getAllNews", "News"));
        }
        public Task<ViewResult> Index()
        {
            return Task<ViewResult>.Factory.StartNew(() =>
            {
                using (var client = new NewsServiceClient())
                {
                    var timer = new Stopwatch();
                    timer.Start();

                    var worldNews = client.GetWorldNews();
                    var sportNews = client.GetSportNews();
                    var funNews = client.GetFunNews();

                    var result = worldNews
                        .Union(sportNews)
                        .Union(funNews)
                        .Convert();

                    timer.Stop();

                    var model = new ViewModel { News = result, Elapsed = timer.Elapsed };

                    return View(model);
                }
            });
        }
Exemplo n.º 9
0
        public ActionResult deleteAuthor(int id)
        {
            NewsServiceClient ins = new NewsServiceClient();

            ins.removeAuthor(id);
            return(RedirectToAction("getAllNews", "News"));
        }
Exemplo n.º 10
0
        public ActionResult updateAuthor(string authorName, string authorCity, HttpPostedFileBase file)
        {
            if (!isLogin())
            {
                return(RedirectToAction("Login", "Author"));
            }
            NewsServiceClient ins = new NewsServiceClient();
            Author            a   = new Author();

            a.authorId = (int)Session["authorid"];
            System.Diagnostics.Debug.WriteLine("&&&&&&&&&&&" + (int)Session["authorid"]);
            a.authorName = authorName;

            a.authorCity = authorCity;

            if (file != null)
            {
                a.authorImage = file.FileName;
                var fileBytes = new byte[file.ContentLength];
                file.InputStream.Read(fileBytes, 0, fileBytes.Length);
                a.imagedata = fileBytes;
            }
            else
            {
                a.authorImage = null;
                a.imagedata   = null;
            }
            System.Diagnostics.Debug.WriteLine("&&&&&&&&&&&77" + a.authorId);
            Author author = ins.updateAuthor(a);

            return(RedirectToAction("getAuthor", "Author", new { id = author.authorId }));
        }
Exemplo n.º 11
0
        public ActionResult addAuthor(string authorName, string password, string authorCity, HttpPostedFileBase file)
        {
            NewsServiceClient ins = new NewsServiceClient();
            Author            a   = new Author();

            a.authorName = authorName;
            a.authorCity = authorCity;
            a.password   = password.ToString();
            //System.Diagnostics.Debug.WriteLine("&&&&&&&&&&&77"+authorName+"&&&"+password+"&&&&&"+authorCity);
            if (file != null)
            {
                a.authorImage = file.FileName;
                var fileBytes = new byte[file.ContentLength];
                file.InputStream.Read(fileBytes, 0, fileBytes.Length);
                a.imagedata = fileBytes;
            }
            else
            {
                a.authorImage = null;
                a.imagedata   = null;
            }
            int id = ins.addAuthor(a);

            Session["authorid"] = id;
            return(RedirectToAction("getAllNews", "News"));
        }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            LibNews kek = new LibNews();

            kek.Title       = "Новая Новость";
            kek.ReleaseDate = DateTime.Now;
            kek.TextContent = "Очень интересное описание новости";

            int?proxyPort = 8000;  // 18000;

            if (proxyPort.HasValue)
            {
                // mitmweb --web-port 28000 --listen-port 18000 --mode reverse:http://localhost:13044
                var kk = new NewsServiceClient("BasicHttpBinding_INewsService",
                                               $"http://localhost:{proxyPort.Value}/INewService");
                var ar = kk.SelectAllCategory();
                foreach (var item in ar)
                {
                    Console.WriteLine(item.NameCat);
                }
                kk.CreateNewWithCat(kek, new string[] { "Актуально сейчас", "Актуально всегда" });
                Console.WriteLine("Querying through proxy has been completed");
            }

            Console.ReadLine();
        }
Exemplo n.º 13
0
        public MainForm()
        {
            InstanceContext newsServiceContext = new InstanceContext(new NewsServiceCallback());

            client = new NewsServiceClient(newsServiceContext);
            InitializeComponent();
            ListBox = listBox;
        }
Exemplo n.º 14
0
        public ActionResult getNews(int id)
        {
            NewsServiceClient ins = new NewsServiceClient();
            News n = ins.getNews(id);

            ViewBag.news = n;
            return(View());
        }
Exemplo n.º 15
0
        public ActionResult updateAuthor()
        {
            NewsServiceClient ins = new NewsServiceClient();
            Author            a   = ins.getAuthor((int)Session["authorid"]);

            ViewBag.author = a;
            return(View());
        }
Exemplo n.º 16
0
        public ActionResult updateNews(int id)
        {
            NewsServiceClient ins = new NewsServiceClient();
            News n = ins.getNews(id);

            Session["newsid"] = id;
            ViewBag.news      = n;
            return(View());
        }
Exemplo n.º 17
0
        public ActionResult getAuthor(int id)
        {
            NewsServiceClient ins = new NewsServiceClient();
            Author            a   = ins.getAuthor(id);

            ViewBag.imgsrc     = "data:image;base64," + Convert.ToBase64String(a.imagedata);
            ViewBag.authordata = a;
            return(View());
        }
Exemplo n.º 18
0
        public void CreateNewsItemTest()
        {
            NewsServiceClient client = new NewsServiceClient();

            string reporterID = "4ab87d67-db83-4364-9ded-d6dd4e616a34";
            newsItem nItem = client.CreateNewsItem("News item title", "News item body", reporterID);

            Assert.AreEqual<string>(reporterID, nItem.reportedBy);
            Assert.AreEqual<string>("News item title", nItem.title);
            Assert.AreEqual<string>("News item body", nItem.body);
        }
Exemplo n.º 19
0
        // GET: News
        public ActionResult getAllNews(int authorid = 0, string tag = null, string newscity = null)
        {
            NewsServiceClient ins  = new NewsServiceClient();
            List <News>       list = ins.getAllNews(authorid, tag, newscity).ToList();

            if (list.Count == 0)
            {
                ViewBag.message = "No News available!!";
            }
            ViewBag.List = list;
            return(View());
        }
Exemplo n.º 20
0
        private static long Benchmark(string endpointConfigurationName)
        {
            INewsService serviceClient = new NewsServiceClient(endpointConfigurationName);
            var          watch         = System.Diagnostics.Stopwatch.StartNew();

            for (var i = 0; i < 2000; i++)
            {
                serviceClient.Test();
            }

            watch.Stop();
            return(watch.ElapsedMilliseconds);
        }
Exemplo n.º 21
0
        public ActionResult Login(string authorName, string password)
        {
            NewsServiceClient ins    = new NewsServiceClient();
            Author            author = ins.Login(authorName, password);

            if (author.authorId <= 0)
            {
                ViewBag.Message = "Userneme and password incorrect!!";
                return(RedirectToAction("Login", "Author"));
            }
            Session["authorid"] = author.authorId;
            System.Diagnostics.Debug.WriteLine("AUTHOR ID ++++++++" + author.authorId);
            return(RedirectToAction("getAllNews", "News"));
        }
        public Task<ViewResult> Index3()
        {
            var service = new NewsServiceClient();
            var client = new ServiceDecorator(service);

            var timer = new Stopwatch();
            timer.Start();

            return
                from w in client.GetWorldNewsTaskAsync()
                from s in client.GetSportNewsTaskAsync()
                from f in client.GetFunNewsTaskAsync()
                let all = w.Union(s).Union(f).Convert()
                select View("Index",
                    new ViewModel { News = f.Convert(), Elapsed = timer.Elapsed });
        }
        public void IndexAsync()
        {
            AsyncManager.OutstandingOperations.Increment(3);
            var service = new NewsServiceClient();
            service.GetWorldNewsCompleted
                += service_GetWorldNewsCompleted;
            service.GetSportNewsCompleted
                += service_GetSportNewsCompleted;
            service.GetFunNewsCompleted
                += service_GetFunNewsCompleted;

            service.GetWorldNewsAsync();
            service.GetSportNewsAsync();
            service.GetFunNewsAsync();

            _timer.Start();
        }
        public Task <ViewResult> Index3()
        {
            var service = new NewsServiceClient();
            var client  = new ServiceDecorator(service);

            var timer = new Stopwatch();

            timer.Start();

            return
                (from w in client.GetWorldNewsTaskAsync()
                 from s in client.GetSportNewsTaskAsync()
                 from f in client.GetFunNewsTaskAsync()
                 let all = w.Union(s).Union(f).Convert()
                           select View("Index",
                                       new ViewModel { News = f.Convert(), Elapsed = timer.Elapsed }));
        }
Exemplo n.º 25
0
 private void cbRestaurantAdd_DropDown(object sender, EventArgs e)
 {
     try
     {
         var NSC = new NewsServiceClient("BasicHttpBinding_INewsService",
                                         $"http://{wcfServerIp}/INewService");
         string[] restaurants = NSC.SelectRestorans();
         cbRestaurantAdd.Items.Clear();
         foreach (var restaurant in restaurants)
         {
             cbRestaurantAdd.Items.Add(restaurant);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Server with restaurants is not connected right now");
     }
 }
        public void IndexAsync()
        {
            AsyncManager.OutstandingOperations.Increment(3);
            var service = new NewsServiceClient();

            service.GetWorldNewsCompleted
                += service_GetWorldNewsCompleted;
            service.GetSportNewsCompleted
                += service_GetSportNewsCompleted;
            service.GetFunNewsCompleted
                += service_GetFunNewsCompleted;

            service.GetWorldNewsAsync();
            service.GetSportNewsAsync();
            service.GetFunNewsAsync();

            _timer.Start();
        }
Exemplo n.º 27
0
 private void cbCategory_DropDown(object sender, EventArgs e)
 {
     try
     {
         var NSC = new NewsServiceClient("BasicHttpBinding_INewsService",
                                         $"http://{wcfServerIp}/INewService");
         LibCategory[] allCategories = NSC.SelectAllCategory();
         cbCategory.Items.Clear();
         foreach (var category in allCategories)
         {
             cbCategory.Items.Add(category.NameCat);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Server with categories is not connected right now");
     }
 }
Exemplo n.º 28
0
 private void cbRestaurants_DropDown(object sender, EventArgs e)
 {
     try
     {
         var NSC = new NewsServiceClient("BasicHttpBinding_INewsService",
                                         $"http://{wcfServerIp}/INewService");
         int      sitsCount = Convert.ToInt32(nudSitsCount.Value);
         string[] restaurantsWithSitsCount = NSC.SelectRestWithCount(sitsCount);
         cbRestaurants.Items.Clear();
         foreach (var restaurant in restaurantsWithSitsCount)
         {
             cbRestaurants.Items.Add(restaurant);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Server with restaurants is not connected right now");
     }
 }
Exemplo n.º 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string                       searchOption = searchBox.Text;
                NewsServiceClient            newsSvc      = new NewsServiceClient();
                AdminClientApp.NewsSVC.New[] newsArr      = newsSvc.GetTenNews(searchOption);
                LV1.DataSource = newsArr;
                LV1.DataBind();


                int[] userIDs = new int[5] {
                    1, 2, 3, 4, 5
                };
                Random random = new Random();
                int    index  = random.Next(0, userIDs.Length);
                int    userID = userIDs[index];
                Session["userID"] = userID;
            }
        }
Exemplo n.º 30
0
        protected void BtnRank_Click(object sender, CommandEventArgs e)
        {
            NewsServiceClient newsSvc = new NewsServiceClient();

            AdminClientApp.NewsSVC.Ranking ranking = new AdminClientApp.NewsSVC.Ranking();
            using (ListView row = (ListView)((ImageButton)sender).Parent.Parent.Parent.Parent.Parent)
            {
                int newsID = int.Parse(e.CommandArgument.ToString());
                ranking.NewsID = newsID;
                ranking.UserID = int.Parse(Session["userID"].ToString());
                if (e.CommandName.ToString() == "Positive")
                {
                    ranking.Rank = 1;
                }
                else
                {
                    ranking.Rank = 0;
                }
                newsSvc.AddToRanking(ranking);
            }
        }
Exemplo n.º 31
0
        public void ProcessRequest(HttpContext context)
        {
            NewsServiceClient newsSvc = new NewsServiceClient();
            int id = int.Parse(context.Request.QueryString["ID"]);

            byte[] imageArr = newsSvc.GetNewsPhoto(id);

            context.Response.ContentType = "image/*";
            context.Response.OutputStream.Write(imageArr, 0, imageArr.Length);
            //byte[] buffer = new byte[4096];
            // int byteSeq;
            // if (strm != null)
            //  byteSeq = strm.Read(buffer, 0, 4096);
            //else
            //  byteSeq = 0;

            //while (byteSeq > 0)
            // {
            //    context.Response.OutputStream.Write(buffer, 0, byteSeq);
            // byteSeq = strm.Read(buffer, 0, 4096);
            // }
        }
Exemplo n.º 32
0
        private void btLoadNews_Click(object sender, EventArgs e)
        {
            try
            {
                LibNews[] restaurantNews;
                string    restaurantName = cbRestaurants.Text;
                var       NSC            = new NewsServiceClient("BasicHttpBinding_INewsService",
                                                                 $"http://{wcfServerIp}/INewService");

                restaurantNews = NSC.SelectNewsFromRestoran(restaurantName);
                dgvRestNews.Rows.Clear();
                foreach (var news in restaurantNews)
                {
                    dgvRestNews.Rows.Add();
                    dgvRestNews.Rows[dgvRestNews.Rows.Count - 1].Cells[0].Value = news.Title;
                    dgvRestNews.Rows[dgvRestNews.Rows.Count - 1].Cells[1].Value = news.TextContent;
                    dgvRestNews.Rows[dgvRestNews.Rows.Count - 1].Cells[2].Value = news.ReleaseDate;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Server with restaurants is not connected right now");
            }
        }
Exemplo n.º 33
0
        public void ModifyNewsItemTest()
        {
            NewsServiceClient client = new NewsServiceClient();

            byte[] bytes = Encoding.UTF8.GetBytes("hola mundo");

            newsItem nItem = new newsItem()
            {
                title = "News Item Title",
                body = "News Item Body",
                reportedBy = "4ab87d67-db83-4364-9ded-d6dd4e616a34",
                picture = bytes,
                pictureScale = 16.9,
                pictureScaleSpecified = true,
                pictureSize = bytes.Length,
                pictureSizeSpecified = true,
                rating = 10,
                ratingSpecified = true,
                reviews = 50,
                reviewsSpecified = true
            };

            string id = client.ReportNewsItem(nItem);

            newsItem nItemFromDB = client.GetNewsItem(id);

            nItemFromDB.title = "Modified title";
            nItemFromDB.body = "Modified body";
            nItemFromDB.rating = 5;
            nItemFromDB.ratingSpecified = true;
            nItemFromDB.reviews = 1;
            nItemFromDB.reviewsSpecified = true;

            client.ModifyNewsItem(nItemFromDB);

            nItemFromDB = client.GetNewsItem(nItemFromDB.id);

            Assert.IsNotNull(nItemFromDB);
            Assert.AreEqual<string>(id, nItemFromDB.id);
            Assert.AreEqual<string>("Modified title", nItemFromDB.title);
            Assert.AreEqual<string>("Modified body", nItemFromDB.body);
            Assert.AreEqual<short>(5, nItemFromDB.rating);
            Assert.AreEqual<int>(1, nItemFromDB.reviews);

            client.DeleteNewsItem(id);
        }
 public ServiceDecorator(NewsServiceClient client)
 {
     _client = client;
 }
Exemplo n.º 35
0
        public void ReportNewsItemTest()
        {
            NewsServiceClient client = new NewsServiceClient();

            string reporterID = "4ab87d67-db83-4364-9ded-d6dd4e616a34";
            newsItem nItem = client.CreateNewsItem("News item title", "News item body", reporterID);

            nItem.picture = Encoding.UTF8.GetBytes("hola coca cola");
            nItem.pictureScale = 16.9;
            nItem.pictureScaleSpecified = true;
            nItem.pictureSize = 20;
            nItem.pictureSizeSpecified = true;
            nItem.rating = 3;
            nItem.ratingSpecified = true;
            nItem.reviews = 50;
            nItem.reviewsSpecified = true;

            string nItemID = client.ReportNewsItem(nItem);

            Assert.IsFalse(string.IsNullOrEmpty(nItemID));

            client.DeleteNewsItem(nItemID);
        }
Exemplo n.º 36
0
        public void GetLatestNewsTest()
        {
            NewsServiceClient client = new NewsServiceClient();

            byte[] bytes = Encoding.UTF8.GetBytes("hola mundo");

            newsItem nItem = new newsItem()
            {
                title = "News Item1 Title",
                body = "News Item1 Body",
                reportedBy = "4ab87d67-db83-4364-9ded-d6dd4e616a34",
                picture = bytes,
                pictureScale = 16.9,
                pictureScaleSpecified = true,
                pictureSize = bytes.Length,
                pictureSizeSpecified = true,
                rating = 10,
                ratingSpecified = true,
                reviews = 50,
                reviewsSpecified = true,
                tags = new string[] { "tag1", "tag2", "tag3" },
                categories = new newsItemEntry[] {
                    new newsItemEntry() { key="sport", value="Sports" },
                    new newsItemEntry() { key="economy", value="Bussiness and Economy" }
                }
            };

            string id1 = client.ReportNewsItem(nItem);

            bytes = Encoding.UTF8.GetBytes("hola guapa");

            nItem = new newsItem()
            {
                title = "News Item2 Title",
                body = "News Item2 Body",
                reportedBy = "4ab87d67-8888-4444-9999-d6dd4e616a34",
                picture = bytes,
                pictureScale = 16.9,
                pictureScaleSpecified = true,
                pictureSize = bytes.Length,
                pictureSizeSpecified = true,
                rating = 10,
                ratingSpecified = true,
                reviews = 50,
                reviewsSpecified = true,
                tags = new string[] { "tag4", "tag5" },
                categories = new newsItemEntry[] {
                    new newsItemEntry() { key="culture", value="Culture and Art" },
                    new newsItemEntry() { key="international", value="International" }
                }
            };

            string id2 = client.ReportNewsItem(nItem);

            newsItem[] latest = client.GetLatestNews(1);

            Assert.IsNotNull(latest);
            Assert.AreEqual<int>(1, latest.Length);

            client.DeleteNewsItem(id1);
            client.DeleteNewsItem(id2);
        }
 public ServiceDecorator(NewsServiceClient client)
 {
     _client = client;
 }
Exemplo n.º 38
0
        public void GetNewsItemTest()
        {
            NewsServiceClient client = new NewsServiceClient();

            byte[] bytes = Encoding.UTF8.GetBytes("hola mundo");

            newsItem nItem = new newsItem()
            {
                title = "News Item Title",
                body = "News Item Body",
                reportedBy = "4ab87d67-db83-4364-9ded-d6dd4e616a34",
                picture = bytes,
                pictureScale = 16.9,
                pictureScaleSpecified = true,
                pictureSize = bytes.Length,
                pictureSizeSpecified = true,
                rating = 10,
                ratingSpecified = true,
                reviews = 50,
                reviewsSpecified = true,
                tags = new string[] { "tag1", "tag2", "tag3" },
                categories = new newsItemEntry[] {
                    new newsItemEntry() { key="sport", value="Sports" },
                    new newsItemEntry() { key="economy", value="Bussiness and Economy" }
                }
            };

            string id = client.ReportNewsItem(nItem);

            newsItem nItemFromDB = client.GetNewsItem(id);

            Assert.IsNotNull(nItemFromDB.id);
            Assert.AreEqual<string>(id, nItemFromDB.id);
            Assert.AreEqual<string>("News Item Title", nItemFromDB.title);
            Assert.AreEqual<string>("News Item Body", nItemFromDB.body);
            Assert.AreEqual<string>("4ab87d67-db83-4364-9ded-d6dd4e616a34", nItemFromDB.reportedBy);

            client.DeleteNewsItem(id);
        }
Exemplo n.º 39
0
 static UsersServiceHelper()
 {
     var client = new NewsServiceClient();
     Users = new BindingList<UserDto>(client.GetAllUsersWithDeleted().OrderBy(u => u.Login).ToList());
     client.Close();
 }