public void ShouldThrowExceptionWhenLabelIsNull()
            {
                IAction action = new CameraRollAction();

                ExceptionAssert.Throws <InvalidOperationException>("The label cannot be null.", () =>
                {
                    action.Validate();
                });
            }
            public void ShouldNotThrowExceptionWhenValid()
            {
                IAction action = new CameraRollAction()
                {
                    Label = "Test"
                };

                action.Validate();
            }
Beispiel #3
0
            public void ShouldThrowExceptionWhenValueIsMoreThan20Chars()
            {
                var action = new CameraRollAction();

                ExceptionAssert.Throws <InvalidOperationException>("The label cannot be longer than 20 characters.", () =>
                {
                    action.Label = new string('x', 21);
                });
            }
Beispiel #4
0
            public void ShouldThrowExceptionWhenValueIsEmpty()
            {
                var action = new CameraRollAction();

                ExceptionAssert.Throws <InvalidOperationException>("The label cannot be null or whitespace.", () =>
                {
                    action.Label = string.Empty;
                });
            }
Beispiel #5
0
            public void ShouldNotThrowExceptionWhenValueIs20Chars()
            {
                var value = new string('x', 20);

                var action = new CameraRollAction()
                {
                    Label = value
                };

                Assert.AreEqual(value, action.Label);
            }
            public void ShouldCreateSerializeableObject()
            {
                var action = new CameraRollAction
                {
                    Label = "Test"
                };

                string serialized = JsonConvert.SerializeObject(action);

                Assert.AreEqual(@"{""type"":""cameraRoll"",""label"":""Test""}", serialized);
            }
            public void ShouldNotThrowExceptionWhenActionIsCameraRollAction()
            {
                var action = new CameraRollAction();

                IActionExtensions.CheckActionType(action);
            }