コード例 #1
0
        public void SetUp()
        {
            var a = new AssemblyFailFaultCode
            {
                FaultCode   = "f1",
                Description = "desc1"
            };

            var b = new AssemblyFailFaultCode
            {
                FaultCode   = "f2",
                Description = "desc2"
            };


            this.FaultCodeService.GetAll()
            .Returns(new SuccessResult <IEnumerable <AssemblyFailFaultCode> >(new List <AssemblyFailFaultCode> {
                a, b
            }));


            this.Response = this.Browser.Get(
                "/production/quality/assembly-fail-fault-codes",
                with => { with.Header("Accept", "application/json"); }).Result;
        }
コード例 #2
0
        public void SetUp()
        {
            this.code        = "CODE";
            this.description = "DESCRIPTION";
            this.explanation = "Here is an explanation";

            this.requestResource = new AssemblyFailFaultCodeResource
            {
                FaultCode   = this.code,
                Description = this.description,
                Explanation = this.explanation
            };

            var faultCode = new AssemblyFailFaultCode
            {
                FaultCode   = this.code,
                Description = this.description,
                Explanation = this.explanation
            };

            this.FaultCodeService.Add(Arg.Any <AssemblyFailFaultCodeResource>())
            .Returns(new CreatedResult <AssemblyFailFaultCode>(faultCode));

            this.Response = this.Browser.Post(
                "/production/quality/assembly-fail-fault-codes",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.requestResource);
            }).Result;
        }
コード例 #3
0
        public void SetUp()
        {
            this.code        = "CODE";
            this.description = "DESCRIPTION";
            this.explanation = "Here is an explanation";

            var faultCode = new AssemblyFailFaultCode
            {
                FaultCode   = this.code,
                Description = this.description,
                Explanation = this.explanation
            };

            this.FaultCodeService.GetById(this.code).Returns(new SuccessResult <AssemblyFailFaultCode>(faultCode));

            this.Response = this.Browser.Get(
                "/production/quality/assembly-fail-fault-codes/CODE",
                with => { with.Header("Accept", "application/json"); }).Result;
        }