Esempio n. 1
0
        public void SetUp()
        {
            var sernosNote1 = new SernosNote("notes")
            {
                SernosGroup  = "group",
                SernosNoteId = 111,
                SernosNumber = 222,
                SernosTRef   = 333,
                TransCode    = "code"
            };

            var sernosNote2 = new SernosNote("notes")
            {
                SernosGroup  = "other group",
                SernosNoteId = 11123,
                SernosNumber = 222,
                SernosTRef   = 333432,
                TransCode    = "code"
            };

            this.SernosNoteService.Search("222").Returns(
                new SuccessResult <IEnumerable <SernosNote> >(new List <SernosNote> {
                sernosNote1, sernosNote2
            }));

            this.Response = this.Browser.Get(
                "/products/maint/serial-numbers/notes",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Query("sernosNumber", "222");
            }).Result;
        }
Esempio n. 2
0
        public void SetUp()
        {
            this.requestResource = new SernosNoteCreateResource()
            {
                SernosNotes  = "notes",
                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.Add(Arg.Any <SernosNoteCreateResource>())
            .Returns(new CreatedResult <SernosNote>(sernosNote)
            {
                Data = sernosNote
            });

            this.Response = this.Browser.Post(
                "products/maint/serial-numbers/notes",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.requestResource);
            }).Result;
        }
Esempio n. 3
0
 public void SetUpContext()
 {
     this.Sut = new SernosNote("note")
     {
         SernosGroup  = "group",
         SernosNumber = 1,
         TransCode    = "code",
         SernosNoteId = 1,
         SernosTRef   = 1
     };
 }
        public void SetUp()
        {
            this.sernosNote = new SernosNote("notes")
            {
                SernosGroup  = "group",
                SernosNoteId = 111,
                SernosNumber = 222,
                SernosTRef   = 333,
                TransCode    = "code"
            };

            this.SernosNoteRepository.FindById(111).Returns(this.sernosNote);
            this.result = this.Sut.GetById(111);
        }
Esempio n. 5
0
        public void SetUp()
        {
            this.sernosNote = new SernosNote("notes")
            {
                SernosGroup  = "group",
                SernosNoteId = 111,
                SernosNumber = 222,
                SernosTRef   = 333,
                TransCode    = "code"
            };

            this.SernosNoteRepository.FilterBy(Arg.Any <Expression <Func <SernosNote, bool> > >()).Returns(new List <SernosNote> {
                this.sernosNote
            }.AsQueryable());
            this.result = this.Sut.Search("222");
        }
Esempio n. 6
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()
        {
            var sernosNote = new SernosNote("notes")
            {
                SernosGroup  = "group",
                SernosNoteId = 111,
                SernosNumber = 222,
                SernosTRef   = 333,
                TransCode    = "code"
            };

            this.SernosNoteService.GetById(111)
            .Returns(new SuccessResult <SernosNote>(sernosNote)
            {
                Data = sernosNote
            });

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