Пример #1
0
        public void SetUp()
        {
            this.requestResource = new SernosConfigResource {
                Description = "new description", SerialNumbered = "N"
            };
            var sernosConfig = new SernosConfig("name", "Y", 2, 3)
            {
                Description = "new description"
            };

            this.SernosConfigService.Update("name", Arg.Any <SernosConfigResource>())
            .Returns(new SuccessResult <SernosConfig>(sernosConfig)
            {
                Data = sernosConfig
            });

            this.Response = this.Browser.Put(
                "/products/maint/sernos-configs/name",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.requestResource);
            }).Result;
        }
Пример #2
0
        public void SetUp()
        {
            this.resource = new SernosConfigResource
            {
                SerialNumbered = "Y",
                Description    = "Desc"
            };

            this.result = this.Sut.Add(this.resource);
        }
Пример #3
0
        public void SetUp()
        {
            this.resource = new SernosConfigResource
            {
                Name        = "cartonName",
                Description = "Desc",
                StartOn     = "Any"
            };

            this.result = this.Sut.Add(this.resource);
        }
 public void SetUp()
 {
     this.name     = "c1";
     this.resource = new SernosConfigResource
     {
         Name           = "Nonsense",
         Description    = "new desc",
         SerialNumbered = "Y",
         NumberOfSernos = 2,
         NumberOfBoxes  = 1,
         StartOn        = "ANY"
     };
     this.SernosConfigRepository.FindById(this.name)
     .Returns(new SernosConfig(this.name, "N", 1, 1));
     this.result = this.Sut.Update(this.name, this.resource);
 }
Пример #5
0
        public void SetUp()
        {
            this.requestResource = new SernosConfigResource {
                Name = "c1"
            };
            var sernosConfig = new SernosConfig("name", "Y", 2, 3);

            this.SernosConfigService.Add(Arg.Any <SernosConfigResource>())
            .Returns(new CreatedResult <SernosConfig>(sernosConfig)
            {
                Data = sernosConfig
            });

            this.Response = this.Browser.Post(
                "/products/maint/sernos-configs",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.requestResource);
            }).Result;
        }