Ejemplo n.º 1
0
        public void ChangeNameStatusTest()
        {
            // get test
            Assert.That(actual: ChangeNameStatus.Processing.ToString(), expression: Is.EqualTo(expected: "processing"));
            Assert.That(actual: ChangeNameStatus.Declined.ToString(), expression: Is.EqualTo(expected: "declined"));
            Assert.That(actual: ChangeNameStatus.Success.ToString(), expression: Is.EqualTo(expected: "success"));
            Assert.That(actual: ChangeNameStatus.WasAccepted.ToString(), expression: Is.EqualTo(expected: "was_accepted"));
            Assert.That(actual: ChangeNameStatus.WasDeclined.ToString(), expression: Is.EqualTo(expected: "was_declined"));

            // parse test
            Assert.That(actual: ChangeNameStatus.FromJsonString(response: "processing")
                        , expression: Is.EqualTo(expected: ChangeNameStatus.Processing));

            Assert.That(actual: ChangeNameStatus.FromJsonString(response: "declined")
                        , expression: Is.EqualTo(expected: ChangeNameStatus.Declined));

            Assert.That(actual: ChangeNameStatus.FromJsonString(response: "success")
                        , expression: Is.EqualTo(expected: ChangeNameStatus.Success));

            Assert.That(actual: ChangeNameStatus.FromJsonString(response: "was_accepted")
                        , expression: Is.EqualTo(expected: ChangeNameStatus.WasAccepted));

            Assert.That(actual: ChangeNameStatus.FromJsonString(response: "was_declined")
                        , expression: Is.EqualTo(expected: ChangeNameStatus.WasDeclined));
        }
Ejemplo n.º 2
0
        public void ChangeNameStatusTest()
        {
            // get test
            Assert.That(ChangeNameStatus.Processing.ToString(), Is.EqualTo("processing"));
            Assert.That(ChangeNameStatus.Declined.ToString(), Is.EqualTo("declined"));
            Assert.That(ChangeNameStatus.Success.ToString(), Is.EqualTo("success"));
            Assert.That(ChangeNameStatus.WasAccepted.ToString(), Is.EqualTo("was_accepted"));
            Assert.That(ChangeNameStatus.WasDeclined.ToString(), Is.EqualTo("was_declined"));

            // parse test
            Assert.That(ChangeNameStatus.FromJsonString("processing")
                        , Is.EqualTo(ChangeNameStatus.Processing));

            Assert.That(ChangeNameStatus.FromJsonString("declined")
                        , Is.EqualTo(ChangeNameStatus.Declined));

            Assert.That(ChangeNameStatus.FromJsonString("success")
                        , Is.EqualTo(ChangeNameStatus.Success));

            Assert.That(ChangeNameStatus.FromJsonString("was_accepted")
                        , Is.EqualTo(ChangeNameStatus.WasAccepted));

            Assert.That(ChangeNameStatus.FromJsonString("was_declined")
                        , Is.EqualTo(ChangeNameStatus.WasDeclined));
        }
Ejemplo n.º 3
0
        public ChangeNameResult(ChangeNameStatus changeNameStatus, Badger badger = null)
        {
            if (changeNameStatus == ChangeNameStatus.Ok && badger == null)
            {
                throw new ArgumentException("ChangeNameStatus can't be OK if badger is null", nameof(badger));
            }
            if (badger != null && changeNameStatus != ChangeNameStatus.Ok)
            {
                throw new ArgumentException("ChangeNameStatus must be OK when badger is not null", nameof(changeNameStatus));
            }

            Status        = changeNameStatus;
            UpdatedBadger = badger;
        }