public NewStatusDialog() { InitializeComponent(); NewStatusPresenter newPresenter = new NewStatusPresenter(this); _presenter = newPresenter; statusBox.DataBindings.Add("Text", newPresenter, "Message"); }
public void Collection() { Tv tv = new Tv(); tv.name = "France 2"; Presenter presNok = new Presenter(); presNok.name = null; Presenter presOk = new Presenter(); presOk.name = "Thierry Ardisson"; tv.presenters.Add(presOk); tv.presenters.Add(presNok); IClassValidator validator = GetClassValidator(typeof(Tv)); var values = validator.GetInvalidValues(tv).ToArray(); values.Should().Not.Be.Empty(); values.Single().PropertyPath.Should().Be.EqualTo("presenters[1].name"); tv.presenters.Clear(); tv.dontNeedDeepValidation = new List<string>(); tv.dontNeedDeepValidation.Add("something"); values = validator.GetInvalidValues(tv).ToArray(); values.Should().Be.Empty(); tv.dontNeedDeepValidation.Add("something else"); values = validator.GetInvalidValues(tv).ToArray(); values.Should().Not.Be.Empty(); values.Single().PropertyPath.Should().Be.EqualTo("dontNeedDeepValidation"); }
public void Collection() { Tv tv = new Tv(); tv.name = "France 2"; Presenter presNok = new Presenter(); presNok.name = null; Presenter presOk = new Presenter(); presOk.name = "Thierry Ardisson"; tv.presenters.Add(presOk); tv.presenters.Add(presNok); IClassValidator validator = GetClassValidator(typeof(Tv)); InvalidValue[] values = validator.GetInvalidValues(tv); Assert.AreEqual(1, values.Length); Assert.AreEqual("presenters[1].name", values[0].PropertyPath); tv.presenters.Clear(); tv.dontNeedDeepValidation = new List<string>(); tv.dontNeedDeepValidation.Add("something"); values = validator.GetInvalidValues(tv); Assert.AreEqual(0, values.Length); tv.dontNeedDeepValidation.Add("something else"); values = validator.GetInvalidValues(tv); Assert.AreEqual(1, values.Length); Assert.AreEqual("dontNeedDeepValidation", values[0].PropertyPath); }
public void OnItemSelected(Presenter.ViewHolder itemViewHolder, Java.Lang.Object item, RowPresenter.ViewHolder rowViewHolder, Row row) { if (item is Movie) { mBackgroundURI = ((Movie)item).GetBackgroundImageURI (); StartBackgroundTimer (); } }
public Game(Presenter presenter, Map map) { this.map = map; this.presenter = presenter; player = new HumanPlayer(); Mover= new RandomWumpusMover(); gameRunning = true; }
public void CalculoDeTotal() { var vista = new FakeView(); var p = new Presenter(vista, new DateTime(2002, 1, 1)); p.Initialize(); Assert.AreEqual(13, p.CalcularTotal(20, 5, 2)); }
public void CanUseStubSyntaxOnMocksInRecordMode() { var service = MockRepository.GenerateStub<IService>(); var view = MockRepository.GenerateStub<IView>(); service.Stub(x => x.GetString()).Return("Test"); var presenter = new Presenter(view, service); presenter.OnViewLoaded(); view.AssertWasCalled(x => x.Message = "Test"); }
public void GrabacionFallida() { var vista = new FakeView(); var p = new Presenter(vista); p.Initialize(); Assert.IsFalse(p.Grabar(10, 10, 4), "No deberia haber grabado con estos datos"); }
public void CallingAssertWasCalledOnAnObjectThatIsInRecordModeShouldResultInFailure() { var service = MockRepository.GenerateStub<IService>(); var view = new MockRepository().Stub<IView>(); service.Stub(x => x.GetString()).Return("Test"); var presenter = new Presenter(view, service); presenter.OnViewLoaded(); view.AssertWasCalled(x => x.Message = "Test"); }
public void GrabacionExitosa() { var vista = new FakeView(); var p = new Presenter(vista); p.Initialize(); Assert.IsTrue(p.Grabar(30, 10, 4), "Deberia haber grabado con estos datos"); }
public void CallingAssertWasCalledOnAnObjectThatIsInRecordModeShouldResultInFailure() { var service = MockRepository.GenerateStub<IService>(); var view = new MockRepository().Stub<IView>(); service.Stub(x => x.GetString()).Return("Test"); var presenter = new Presenter(view, service); presenter.OnViewLoaded(); var ex = Assert.Throws<InvalidOperationException>(() => view.AssertWasCalled(x => x.Message = "Test")); Assert.Equal("Cannot assert on an object that is not in replay mode. Did you forget to call ReplayAll() ?", ex.Message); }
public void OnItemClicked(Presenter.ViewHolder itemViewHolder, Java.Lang.Object item, RowPresenter.ViewHolder rowViewHolder, Row row) { if (item is Movie) { var movie = (Movie)item; var intent = new Intent (this.Activity, typeof(DetailsActivity)); intent.PutExtra (GetString (Resource.String.movie), Utils.Serialize(movie)); StartActivity (intent); } }
public WallPostDialog(string uid, string name) { InitializeComponent(); this.Id = uid; this.RecipientName = name; this.Text += RecipientName; // update the title bar NewWallPostPresenter newPresenter = new NewWallPostPresenter(this, this.Id); _presenter = newPresenter; postBox.DataBindings.Add("Text", newPresenter, "Message"); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Creating new MVC triplet Model model = new Model(); //The model FormView mainView = new FormView(model, AREA_WIDTH, AREA_HEIGHT, AREA_OFFSET); // The view Presenter presenter = new Presenter(model, mainView, AREA_WIDTH, AREA_HEIGHT, AREA_OFFSET); // The presenter // Running the app Application.Run(mainView); }
/// <summary> /// Deserialize the object /// </summary> public static IList<Presenter> DeserializeJson(JToken inputObject) { IList<Presenter> deserializedObject = new List<Presenter>(); foreach (JToken iListValue in ((JArray)inputObject)) { Presenter presenter = new Presenter(); presenter.DeserializeJson(iListValue); deserializedObject.Add(presenter); } return deserializedObject; }
/// <summary> /// Creates main window /// </summary> /// <returns>Main window</returns> public static MainWindow GetMainWindow() { IDataAccessLayer dataAccessLayer = new DataAccessLayer(); IMapper mapper = new Mapper(); IDataProvider dataProvider = new DataProvider(dataAccessLayer, mapper); IInferenceLogger inferenceLogger = new InferenceLogger(); IInferenceModule inferenceModule = new InferenceModule(dataProvider, inferenceLogger); IPresenter presenter = new Presenter(inferenceModule, dataAccessLayer); MainWindow mainWindow = new MainWindow(presenter); return mainWindow; }
public void Start() { consoleDisplay = new ConsoleDisplay(); gamePresenter = new GamePresenter(consoleDisplay); map = new Map(); SetupMap(); game = new Game(gamePresenter, map); gamePresenter.Game = game; RunGameLoop(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ////////// MVP binding ////////////// var view = new MVP.UI.View(); var service = new MVP.UI.Service(); var presenter = new Presenter(view, service); ///////////////////////////////////// Application.Run(view); }
public void ClearedModelSetsItemsOnView() { IModel model = MockRepository.GenerateStrictMock<IModel>(); IView view = MockRepository.GenerateStrictMock<IView>(); var eventRaiser = model.Expect(x => x.ModelChanged += null).IgnoreArguments().GetEventRaiser(); view.Expect(x => x.SetList(null)).IgnoreArguments(); Presenter subject = new Presenter(view, model); eventRaiser.Raise(this, EventArgs.Empty); model.VerifyAllExpectations(); view.VerifyAllExpectations(); }
public override void OnBindViewHolder (Presenter.ViewHolder viewHolder, Java.Lang.Object item) { Movie movie = (Movie)item; ((CustomViewHolder)viewHolder).movie = movie; if (movie.GetCardImageURI () != null) { var holder = (CustomViewHolder)viewHolder; var card = holder.cardView; card.TitleText = movie.Title; card.ContentText = movie.Studio; card.SetMainImageDimensions (CARD_WIDTH, CARD_HEIGHT); holder.UpdateCardViewImage (movie.GetCardImageURI ()); } }
public void Success() { var service = MockRepository.Mock<IService>(); var view = MockRepository.Mock<IView>(); service.Stub(x => x.GetString()) .Return("Test"); view.Expect(x => x.Message = "Test"); var presenter = new Presenter(view, service); presenter.OnViewLoaded(); view.VerifyAllExpectations(); }
public void GridCellValueChangedEventForBTest() { // Setup testing data and class dependencies var entity = new Model(1, "Name 1", 4, 2, 0, 0); var viewMock = new Mock<IView>(); var serviceMock = new Mock<IService>(); var presenter = new Presenter(viewMock.Object, serviceMock.Object); // Raising testing event view.GridCellValueChanged("B", entity) viewMock.Raise(v => v.GridCellValueChanged += null, "B", entity); // Verifing testing results Assert.AreEqual(6, entity.Sum, "Validate changing of model.Sum property"); Assert.AreEqual(2, entity.Div, "Validate changing of model.Div property"); }
public void ClearedModelSetsItemsOnView() { IModel model = MockRepository.Mock<IModel>(); IView view = MockRepository.Mock<IView>(); model.ExpectEvent(x => x.ModelChanged += null) .IgnoreArguments(); view.Expect(x => x.SetList(null)) .IgnoreArguments(); Presenter subject = new Presenter(view, model); model.Raise(x => x.ModelChanged += null, EventArgs.Empty); model.VerifyExpectations(true); view.VerifyExpectations(true); }
public ChatWindow(Presenter presenter, SenescoController controller) { m_presenter = presenter; m_controller = controller; // Start up this window. InitializeComponent(); // Restore window position. WindowUtils.RestoreWindowPosition(this, null, WindowUtils.DefaultPosition.GlobalDefault); // Clear the window title initially. SetWindowTitle(null); // Synchronize the bookmark menu with the current bookmark files. UpdateBookmarks(); }
public void ClearedModelSetsItemsOnView() { MockRepository mocks = new MockRepository(); IModel model = mocks.StrictMock<IModel>(); IView view = mocks.StrictMock<IView>(); model.ModelChanged += null; LastCall.IgnoreArguments(); IEventRaiser eventRaiser = LastCall.GetEventRaiser(); view.SetList(null); LastCall.IgnoreArguments(); mocks.ReplayAll(); Presenter subject = new Presenter(view, model); eventRaiser.Raise(this, EventArgs.Empty); mocks.VerifyAll(); }
public void FormLoadEventTest() { // Setup testing data and class dependencies var model = new BindingList<Model> { new Model(1, "Name 1", 1, 1, 2, 1) }; var viewMock = new Mock<IView>(); var serviceMock = new Mock<IService>(); serviceMock.Setup(s => s.GetData(It.Is<long>(id=> id == 1))).Returns(model); var presenter = new Presenter(viewMock.Object, serviceMock.Object); // Raising testing event view.FormLoad viewMock.Raise(v => v.FormLoad += null); // Verifing testing results serviceMock.Verify( s => s.GetData(It.Is<long>(id => id == 1)), Times.Once(), "Verify pooling of method: service.GetData(1)" ); viewMock.Verify(view => view.BindModel(It.Is<BindingList<Model>>(data => data == model)), Times.Once(), "Verify pooling of method: view.BindModel(data)"); }
public void ShowMessage(string message) { Presenter.ShowMessage(message, Logger); }
public void UpdateCreatedTime(DateTime createdTime) { Presenter.UpdateCreatedTime(CalcCreatedTime(createdTime, DateTime.Now)); }
/// <summary> /// Registers the presenter to the form. /// </summary> /// <param name="presenter"></param> public void RegisterPresenter(Presenter presenter) { m_presenter = presenter; }
private void button1_Click(object sender, EventArgs e) { Presenter.addPerson(); }
private void Button3_Click(object sender, EventArgs e) { Presenter.deleteThongTinXuatBan(); showError(); }
private void allFriendsMenuItem_Click(object sender, EventArgs e) { try { FriendsPresenter friendsPresenter = new FriendsPresenter(this); _presenter = friendsPresenter; friendsPresenter.PictureLoaded += UpdateFriendsListPictures; // TODO: Tidy this up a little. friendsPresenter.FriendsListView.ContextMenuStrip.Items[2].Click += friendPostMenuItem_Click; friendsPresenter.FriendsListView.ContextMenuStrip.Items[3].Click += friendPokeMenuItem_Click; contentPanel.Controls.Clear(); contentPanel.Controls.Add(friendsPresenter.FriendsListView); contentPanel.Controls[0].Focus(); } catch (FacebookApiException ex) { MessageBox.Show(ex.Message, "Error in request", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) { MessageBox.Show(ex.Message, "Iris Unhandled exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void OnFormLoad() { Presenter.OnStartUp(); lstCategories.DataSource = Presenter.listCategories; }
/// <summary> /// Scrolls the specified item into view. /// </summary> /// <param name="item">The item.</param> public void ScrollIntoView(object item) => Presenter?.ScrollIntoView(item);
// GET: Presenters4/Create public ActionResult Create(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Presenter presenter = db.Presenters.Find(id); if (presenter == null) { return(HttpNotFound()); } var item = new Presenter { StudentName = presenter.StudentName, PaperTitle = presenter.PaperTitle, PaperId = presenter.PaperId, eyecons = new List <Eyecon> { new Eyecon { Id = 1, EyeconName = "Poor" }, new Eyecon { Id = 2, EyeconName = "Fair" }, new Eyecon { Id = 3, EyeconName = "Adequate" }, new Eyecon { Id = 4, EyeconName = "Good" }, new Eyecon { Id = 5, EyeconName = "Excellent" }, }, claritys = new List <Clarity> { new Clarity { Id = 1, ClarityName = "Poor" }, new Clarity { Id = 2, ClarityName = "Fair" }, new Clarity { Id = 3, ClarityName = "Adequate" }, new Clarity { Id = 4, ClarityName = "Good" }, new Clarity { Id = 5, ClarityName = "Excellent" }, }, intengs = new List <Inteng> { new Inteng { Id = 1, IntengName = "Poor" }, new Inteng { Id = 2, IntengName = "Fair" }, new Inteng { Id = 3, IntengName = "Adequate" }, new Inteng { Id = 4, IntengName = "Good" }, new Inteng { Id = 5, IntengName = "Excellent" }, }, timekees = new List <Timekee> { new Timekee { Id = 1, TimekeeName = "Poor" }, new Timekee { Id = 2, TimekeeName = "Fair" }, new Timekee { Id = 3, TimekeeName = "Adequate" }, new Timekee { Id = 4, TimekeeName = "Good" }, new Timekee { Id = 5, TimekeeName = "Excellent" }, }, origquas = new List <Origqua> { new Origqua { Id = 1, OrigquaName = "Poor" }, new Origqua { Id = 2, OrigquaName = "Fair" }, new Origqua { Id = 3, OrigquaName = "Adequate" }, new Origqua { Id = 4, OrigquaName = "Good" }, new Origqua { Id = 5, OrigquaName = "Excellent" }, }, corlevs = new List <Corlev> { new Corlev { Id = 1, CorlevName = "Poor" }, new Corlev { Id = 2, CorlevName = "Fair" }, new Corlev { Id = 3, CorlevName = "Adequate" }, new Corlev { Id = 4, CorlevName = "Good" }, new Corlev { Id = 5, CorlevName = "Excellent" }, }, wellsturs = new List <Wellstru> { new Wellstru { Id = 1, WellstruName = "Poor" }, new Wellstru { Id = 2, WellstruName = "Fair" }, new Wellstru { Id = 3, WellstruName = "Adequate" }, new Wellstru { Id = 4, WellstruName = "Good" }, new Wellstru { Id = 5, WellstruName = "Excellent" }, }, gooduses = new List <Gooduse> { new Gooduse { Id = 1, GooduseName = "Poor" }, new Gooduse { Id = 2, GooduseName = "Fair" }, new Gooduse { Id = 3, GooduseName = "Adequate" }, new Gooduse { Id = 4, GooduseName = "Good" }, new Gooduse { Id = 5, GooduseName = "Excellent" }, }, questwells = new List <Questwell> { new Questwell { Id = 1, QuestwellName = "Poor" }, new Questwell { Id = 2, QuestwellName = "Fair" }, new Questwell { Id = 3, QuestwellName = "Adequate" }, new Questwell { Id = 4, QuestwellName = "Good" }, new Questwell { Id = 5, QuestwellName = "Excellent" }, }, clearansws = new List <Clearansw> { new Clearansw { Id = 1, ClearanswName = "Poor" }, new Clearansw { Id = 2, ClearanswName = "Fair" }, new Clearansw { Id = 3, ClearanswName = "Adequate" }, new Clearansw { Id = 4, ClearanswName = "Good" }, new Clearansw { Id = 5, ClearanswName = "Excellent" }, } }; return(View(item)); }
public async Task InitializeAsync() { _presenter = await _browsers.CreatePresenter(); await _presenter.LoadTriviaQuestions(); }
/// <summary> /// 构造函数 /// </summary> public DynInputString(Presenter presenter, string value) : base(presenter, value) { }
private void moveFewToRequestButton_Click(object sender, System.EventArgs e) { Presenter.OnMoveToRequestButtonClicked(); }
private void DeleteFromRequestButton_Click(object sender, EventArgs e) { Presenter.OnDeleteFromRequestButtonClicked(); }
private void button2_Click(object sender, EventArgs e) { Presenter.delPerson(); }
private void btnOk_Click(object sender, EventArgs e) { Presenter.OK(); }
private void ExportToFileButton_Click(object sender, EventArgs e) { iOProcess.SaveListToCsvFile(Presenter.GetAllEntites(), FileType, null); }
private void Form1_Load(object sender, EventArgs e) { Presenter.updateListPerson(); }
//Удаление переменной private void deleteButton_Click(object sender, EventArgs e) { Presenter.DeleteVariable(); }
public Program(Presenter presenter) { this.presenter = presenter; }
//Добавление новой переменной private void submitButton_Click(object sender, EventArgs e) { Presenter.AddVariable(variableTextBox.Text); }
public void FavoriteClick() { // TODO: add api _isFavorite = true; Presenter.SetQuoteFavoriteState(_isFavorite); }
public void GetRegisteredByName() { IPresenter p; p = new Presenter("a", false); _controller.RegisterPresenter(p); p = new Presenter("b", false); _controller.RegisterPresenter(p); p = new Presenter("c", false); _controller.RegisterPresenter(p); p = _controller.GetPresenter("b"); Assert.IsNotNull(p); Assert.AreEqual("b", p.Name); }
public void TellsViewToEnableEverything() { Presenter.Handle(new UserGroupSelectedEvent(Guid.NewGuid())); ViewMock.Verify(v => v.EnableEverything()); }
protected override void OnDisposing() { Presenter.Dispose(); base.OnDisposing(); }
//Обработчик изменения выбранной переменной variableListBox private void variableListBox_SelectedIndexChanged(object sender, EventArgs e) { Presenter.UpdateVariablesView(variableListBox.SelectedIndex); }
public ToolBarPostsView(UINavigationItem navigationItem, UINavigationBar navigationBar) { _navigationItem = navigationItem; _navigationBar = navigationBar; _moreButton = new UIBarButtonItem(new UIImage(), UIBarButtonItemStyle.Plain, (sender, e) => { Presenter.MoreClick(); }); _navigationItem.SetLeftBarButtonItem(_moreButton, true); _createPostButton = new UIBarButtonItem("", UIBarButtonItemStyle.Plain, (sender, e) => { Presenter.CreatePostClick(); }); _navigationItem.SetRightBarButtonItem(_createPostButton, true); }
private void closeButton_Click(object sender, EventArgs e) { Presenter.ShowMainForm(); this.Close(); }
/// <summary> /// Closes the job submission panel. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnCancel_Click(object sender, EventArgs e) { Presenter.CancelJobSubmission(); }
private void DisplayNewsFeed() { try { NewsFeedPresenter newsFeedPresenter = new NewsFeedPresenter(this); _presenter = newsFeedPresenter; contentPanel.Controls.Clear(); contentPanel.Controls.Add(newsFeedPresenter.NewsListBox); contentPanel.Controls[0].Focus(); } catch (FacebookApiException ex) { MessageBox.Show(ex.Message, "Error in request", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) { MessageBox.Show(ex.Message, "Iris Unhandled exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnDeleteRecord_Click(object sender, EventArgs e) { //Presenter presenter = new Presenter(); Presenter.DeleteProduct(lstProducts.SelectedItem.ToString()); GetProductsList(); }
protected override void When() { Presenter.SetClient(new ClientReport(_clientId, "Client Name")); Presenter.Display(); }
private void ClearTableButton_Click(object sender, EventArgs e) { Presenter.RemoveEntitesFromList(); }
public LicenseView(Presenter presenter) { InitializeComponent(); this.presenter = presenter; }
private void ReadFilesButton_Click(object sender, EventArgs e) { Presenter.AddEntity(iOProcess.ReadFiles(openFileDialog1, Entities)); }