예제 #1
0
        public IModelState PassTest(TestUser user)
        {
            var status = new ModelStateHandler();

            if (user == null)
            {
                status.AddError("No user provided", nameof(user));
                return(status);
            }
            State = TestState.Passed;

            return(status);
        }
예제 #2
0
        public IModelState Fail(string reason)
        {
            var status = new ModelStateHandler();

            if (string.IsNullOrWhiteSpace(reason))
            {
                status.AddError("You must provide a fail reason.", nameof(reason));
                return(status);
            }
            State  = TestState.Failed;
            Reason = reason;
            return(status);
        }