コード例 #1
0
        public NewsControl()
        {
            InitializeComponent();

            NewsSecService = new NewsSecureServiceClient();
            NewsService = new NewsServiceClient();
        }
コード例 #2
0
        //
        // 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));
            }
        }
コード例 #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();
        }
コード例 #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;
            }
        }
コード例 #5
0
        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);
                }
            }));
        }
コード例 #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;
            }
        }
コード例 #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"));
        }
コード例 #8
0
        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);
                }
            });
        }
コード例 #9
0
        public ActionResult deleteAuthor(int id)
        {
            NewsServiceClient ins = new NewsServiceClient();

            ins.removeAuthor(id);
            return(RedirectToAction("getAllNews", "News"));
        }
コード例 #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 }));
        }
コード例 #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"));
        }
コード例 #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();
        }
コード例 #13
0
        public MainForm()
        {
            InstanceContext newsServiceContext = new InstanceContext(new NewsServiceCallback());

            client = new NewsServiceClient(newsServiceContext);
            InitializeComponent();
            ListBox = listBox;
        }
コード例 #14
0
        public ActionResult getNews(int id)
        {
            NewsServiceClient ins = new NewsServiceClient();
            News n = ins.getNews(id);

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

            ViewBag.author = a;
            return(View());
        }
コード例 #16
0
        public ActionResult updateNews(int id)
        {
            NewsServiceClient ins = new NewsServiceClient();
            News n = ins.getNews(id);

            Session["newsid"] = id;
            ViewBag.news      = n;
            return(View());
        }
コード例 #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());
        }
コード例 #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);
        }
コード例 #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());
        }
コード例 #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);
        }
コード例 #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"));
        }
コード例 #22
0
        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 });
        }
コード例 #23
0
        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();
        }
コード例 #24
0
        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 }));
        }
コード例 #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");
     }
 }
コード例 #26
0
        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();
        }
コード例 #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");
     }
 }
コード例 #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");
     }
 }
コード例 #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;
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            // }
        }
コード例 #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");
            }
        }
コード例 #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);
        }
コード例 #34
0
 public ServiceDecorator(NewsServiceClient client)
 {
     _client = client;
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #37
0
 public ServiceDecorator(NewsServiceClient client)
 {
     _client = client;
 }
コード例 #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);
        }
コード例 #39
0
ファイル: UsersServiceHelper.cs プロジェクト: dizar888/News
 static UsersServiceHelper()
 {
     var client = new NewsServiceClient();
     Users = new BindingList<UserDto>(client.GetAllUsersWithDeleted().OrderBy(u => u.Login).ToList());
     client.Close();
 }