コード例 #1
0
ファイル: AddPointsEvent.cs プロジェクト: rokric/Studi-Budi
 public void RegisterPoints(Question question, int value)
 {
     if (question.Points == 0 && question.Status == 1)
     {
         AddPoints?.Invoke(this, new AddPointsEventArgs(question.QuestionID, value));
     }
 }
コード例 #2
0
ファイル: Block.cs プロジェクト: RomanPay/WackyBreakout
    protected virtual void Start()
    {
        _addPoints = new AddPoints();
        EventManager.AddPointsInvoker(this);

        _blockEvent = new BlockEvent();
        EventManager.BlockInvoker(this);
    }
コード例 #3
0
 public static void AddPointsInvoker(AddPoints inputEvent)
 {
     addPointsInvokers.Add(inputEvent);
     foreach (var currentAction in addPointsListeners)
     {
         inputEvent.AddListener(currentAction);
     }
 }
コード例 #4
0
        public void Ctor_ShouldReturnInstanceOfClass_WhenDependenciesAreValid()
        {
            Mock <ILogger <AddPoints> >   mockLogger = new Mock <ILogger <AddPoints> >();
            Mock <ISkillRequestValidator> mockSkillRequestValidator = new Mock <ISkillRequestValidator>();

            AddPoints sut = new AddPoints(mockLogger.Object, mockSkillRequestValidator.Object);

            Assert.IsType <AddPoints>(sut);
        }
コード例 #5
0
ファイル: Add.cs プロジェクト: awDelya/Ex1
 private void AddNumber_KeyPress(object sender, KeyPressEventArgs e)//нажатие клавиши
 {
     if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
     {
         e.Handled = true;
     }
     if (e.KeyChar.Equals((char)13))
     {
         AddPoints.Focus();
     }
 }
コード例 #6
0
        public void Handle_ShouldReturnSkillResponse_WhenCalled()
        {
            Mock <ILogger <AddPoints> > mockLogger = new Mock <ILogger <AddPoints> >();

            Mock <ISkillRequestValidator> mockSkillRequestValidator = new Mock <ISkillRequestValidator>();

            mockSkillRequestValidator.Setup(x => x.IsValid(It.IsAny <SkillRequest>())).Returns(true);

            AddPoints sut = new AddPoints(mockLogger.Object, mockSkillRequestValidator.Object);

            SkillRequest skillRequest = GenerateValidSkillRequest(new IntentRequest()
            {
                RequestId = "TestRequestId",
                Locale    = "en-US",
                Type      = "IntentRequest",
                Intent    = new Intent()
                {
                    ConfirmationStatus = "CONFIRMED",
                    Name  = "AddPoints",
                    Slots = new Dictionary <string, Slot>()
                    {
                        {
                            "player",
                            new Slot()
                            {
                                Name  = "player",
                                Value = "blue",
                                ConfirmationStatus = "NONE"
                            }
                        },
                        {
                            "amount",
                            new Slot()
                            {
                                Name  = "amount",
                                Value = "3",
                                ConfirmationStatus = "NONE"
                            }
                        }
                    }
                }
            });

            TokenUser tokenUser = new TokenUser()
            {
                Players = new List <Player>()
            };

            SkillResponse skillResponse = sut.Handle(skillRequest, tokenUser);

            Assert.IsType <AddPoints>(sut);
        }
コード例 #7
0
        public void Handle_ShouldThrowArgumentNullException_WhenTokenUserIsNull()
        {
            Mock <ILogger <AddPoints> > mockLogger = new Mock <ILogger <AddPoints> >();

            Mock <ISkillRequestValidator> mockSkillRequestValidator = new Mock <ISkillRequestValidator>();

            mockSkillRequestValidator.Setup(x => x.IsValid(It.IsAny <SkillRequest>())).Returns(true);

            AddPoints sut = new AddPoints(mockLogger.Object, mockSkillRequestValidator.Object);

            SkillRequest skillRequest = new SkillRequest();

            Assert.Throws <ArgumentNullException>(() => sut.Handle(skillRequest, null));
        }
コード例 #8
0
        public void Handle_ShouldThrowArgumentNullException_WhenCalledWithInvalidSkillRequest()
        {
            Mock <ILogger <AddPoints> > mockLogger = new Mock <ILogger <AddPoints> >();

            Mock <ISkillRequestValidator> mockSkillRequestValidator = new Mock <ISkillRequestValidator>();

            mockSkillRequestValidator.Setup(x => x.IsValid(It.IsAny <SkillRequest>())).Returns(false);

            AddPoints sut = new AddPoints(mockLogger.Object, mockSkillRequestValidator.Object);

            TokenUser tokenUser = new TokenUser()
            {
                Players = new List <Player>()
            };

            SkillRequest skillRequest = new SkillRequest();

            Assert.Throws <ArgumentNullException>(() => sut.Handle(skillRequest, tokenUser));
        }
コード例 #9
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     Restart.Invoke();
     AddPoints.Invoke();
     audioSource.Play();
 }
コード例 #10
0
ファイル: ScoreScreen.cs プロジェクト: Justin-Cooney/PitStop
 private void OnAddPoints(AddPoints e)
 {
     _points   += e.Points;
     _text.text = $"Workplace Efficiency Rating: { _points}";
 }
コード例 #11
0
ファイル: Block.cs プロジェクト: outphase27/lcs_Unity
 virtual protected void Start()
 {
     addPoints = new AddPoints();
     EventManager.AddAddPointsInvoker(this);
 }
コード例 #12
0
ファイル: Form1.cs プロジェクト: tundek/LoyaltyApp
        private void addPointsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddPoints ap = new AddPoints();

            ap.Show();
        }
コード例 #13
0
 // Start is called before the first frame update
 protected virtual void Start()
 {
     addPointsEvent = new AddPoints();
     EventManager.AddPointsEventInvoker(this);
 }
コード例 #14
0
ファイル: Coins.cs プロジェクト: LuddeW/Pac-Man
 public Coins(Texture2D texture, Vector2 pos, AddPoints addPoints)
     : base(texture, pos)
 {
     this.addPoints = addPoints;
 }