コード例 #1
0
        public void SetUp()
        {
            this.resource = new BoardFailTypeResource
            {
                FailType    = 1,
                Description = "Desc"
            };

            this.result = this.Sut.Add(this.resource);
        }
コード例 #2
0
        public void SetUp()
        {
            this.resource = new BoardFailTypeResource
            {
                FailType    = 1,
                Description = "Desc",
            };

            this.BoardFailTypeRepository.FindById(1)
            .Returns(new BoardFailType {
                Type = 1, Description = "Old Desc"
            });
            this.result = this.Sut.Update(1, this.resource);
        }
コード例 #3
0
ファイル: WhenAdding.cs プロジェクト: lulzzz/production
        public void SetUp()
        {
            this.requestResource = new BoardFailTypeResource {
                FailType = 1, Description = "Desc"
            };
            var newSkill = new BoardFailType {
                Type = 1, Description = "Desc"
            };

            this.FacadeService.Add(Arg.Any <BoardFailTypeResource>())
            .Returns(new CreatedResult <BoardFailType>(newSkill));

            this.Response = this.Browser.Post(
                "/production/resources/board-fail-types",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.requestResource);
            }).Result;
        }
コード例 #4
0
ファイル: WhenUpdating.cs プロジェクト: lulzzz/production
        public void SetUp()
        {
            this.requestResource = new BoardFailTypeResource {
                FailType = 1, Description = "New Desc"
            };
            var a = new BoardFailType {
                Type = 1, Description = "New Desc"
            };

            this.FacadeService.Update(1, Arg.Any <BoardFailTypeResource>())
            .Returns(new SuccessResult <BoardFailType>(a));

            this.Response = this.Browser.Put(
                "/production/resources/board-fail-types/1",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.requestResource);
            }).Result;
        }