示例#1
0
        public void SetUp()
        {
            this.sernosNote = new SernosNote("note")
            {
                SernosNoteId = 1
            };

            this.resource = new SernosNoteResource
            {
                SernosGroup  = "group",
                SernosNoteId = 1,
                SernosNumber = 1,
                SernosTRef   = 1,
                TransCode    = "code"
            };

            this.SernosNoteRepository.FindById(1).Returns(this.sernosNote);
            this.result = this.Sut.Update(1, this.resource);
        }
        public void SetUp()
        {
            this.requestResource = new SernosNoteResource
            {
                SernosNotes  = "notes",
                SernosNoteId = 111,
                SernosGroup  = "group",
                SernosNumber = 222,
                SernosTRef   = 333,
                TransCode    = "code"
            };

            var sernosNote = new SernosNote("notes")
            {
                SernosNoteId = 111,
                SernosGroup  = "group",
                SernosNumber = 222,
                SernosTRef   = 333,
                TransCode    = "code"
            };

            this.SernosNoteService.Update(111, Arg.Any <SernosNoteResource>())
            .Returns(new SuccessResult <SernosNote>(sernosNote)
            {
                Data = sernosNote
            });

            this.Response = this.Browser.Put(
                "/products/maint/serial-numbers/notes/111",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.requestResource);
            }).Result;
        }