Ejemplo n.º 1
0
 public async Task <IActionResult> MakeLanguageDefault([FromBody] SingleValueObject <int> request)
 {
     return(this.Ok(await this.Mediator.Send(new MakeLanguageDefaultCommand
     {
         LanguageId = request.Value,
     })));
 }
        private void send_btn_Click(object sender, RoutedEventArgs e)
        {
            if (field_value.Text != "")
            {
                MainPushModel mainModel = new MainPushModel();
                switch (type)
                {
                case "popup":
                    PopupModel popup = new PopupModel();
                    popup.uri      = field_value.Text;
                    mainModel.data = popup;
                    break;

                case "twitter":
                case "instagram":
                case "soroush":
                case "ussd":
                    SingleValueObject obj = new SingleValueObject();
                    obj.type       = type;
                    obj.value      = field_value.Text;
                    mainModel.data = obj;
                    break;
                }

                util.PostRequest(JsonConvert.SerializeObject(mainModel), SendPushWindow.FireBaseKey, this);
            }
            else
            {
                MessageBox.Show("Please fill all of the fields", "Data Missed!");
            }
        }
Ejemplo n.º 3
0
        public void TransposedValuesGiveDifferentHashCodes()
        {
            var address  = new SingleValueObject <String>("test");
            var address2 = new SingleValueObject <String>(null);

            Assert.AreNotEqual(address.GetHashCode(), address2.GetHashCode());
        }
Ejemplo n.º 4
0
        public void UnequalValueObjectsHaveDifferentHashCodes()
        {
            var address  = new SingleValueObject <String>("test");
            var address2 = new SingleValueObject <String>("test2");

            Assert.AreNotEqual(address.GetHashCode(), address2.GetHashCode());
        }
Ejemplo n.º 5
0
        public void AddressEqualsWorksWithNulls()
        {
            var address  = new SingleValueObject <String>(null);
            var address2 = new SingleValueObject <String>("test");

            Assert.IsFalse(address.Equals(address2));
        }
Ejemplo n.º 6
0
        public void EqualValueObjectsHaveSameHashCode()
        {
            var address  = new SingleValueObject <String>("test");
            var address2 = new SingleValueObject <String>("test");

            Assert.AreEqual(address.GetHashCode(), address2.GetHashCode());
        }
Ejemplo n.º 7
0
        public void AddressEqualsWorksWithNonIdenticalAddresses()
        {
            var address  = new SingleValueObject <String>("test");
            var address2 = new SingleValueObject <String>("test2");

            Assert.IsFalse(address.Equals(address2));
        }
Ejemplo n.º 8
0
 public async Task <IActionResult> EditTranslation(int translationId, [FromBody] SingleValueObject <string> newValue)
 {
     return(this.Ok(await this.Mediator.Send(new EditTranslationCommand
     {
         TranslationId = translationId,
         NewValue = newValue.Value,
     })));
 }
Ejemplo n.º 9
0
        public void AddressEqualsIsSymmetric()
        {
            var address  = new SingleValueObject <String>("test");
            var address2 = new SingleValueObject <String>("test2");

            Assert.IsFalse(address.Equals(address2));
            Assert.IsFalse(address2.Equals(address));
        }
Ejemplo n.º 10
0
        public void AddressOperatorsWork()
        {
            var address  = new SingleValueObject <String>("test");
            var address2 = new SingleValueObject <String>("test");
            var address3 = new SingleValueObject <String>("test2");

            Assert.IsTrue(address == address2);
            Assert.IsTrue(address2 != address3);
        }
Ejemplo n.º 11
0
        public void AddressEqualsIsTransitive()
        {
            var address  = new SingleValueObject <String>("test");
            var address2 = new SingleValueObject <String>("test");
            var address3 = new SingleValueObject <String>("test");

            Assert.IsTrue(address.Equals(address2));
            Assert.IsTrue(address2.Equals(address3));
            Assert.IsTrue(address.Equals(address3));
        }
Ejemplo n.º 12
0
        public void AddressEqualsIsReflexive()
        {
            var address = new SingleValueObject <String>("test");

            Assert.IsTrue(address.Equals(address));
        }