Exemple #1
0
        public void Should_Success_Get_Data()
        {
            GarmentProduct model    = DataUtil.GetNewData2();
            var            Response = Services.ReadModel(1, 25, "{\"Code\":\"desc\"}", null, "", "{}");

            Assert.NotNull(Response);
        }
        public async void GetDistinctProductwidth()
        {
            GarmentProduct model = await DataUtil.GetTestDataAsync();

            var Response = Services.GetDistinctProductWidth(model.Width, "{\"Width\":\"test\"}");

            Assert.NotNull(Response);
        }
        public async void GetDistinctProductYarn()
        {
            GarmentProduct model = await DataUtil.GetTestDataAsync();

            var Response = Services.GetDistinctProductYarn(model.Yarn, "{\"Yarn\":\"test\"}");

            Assert.NotNull(Response);
        }
        public async void Should_Success_Get_Data_By_Name()
        {
            GarmentProduct model = await DataUtil.GetTestDataAsync();

            var Response = Services.GetByName(model.Name);

            Assert.NotNull(Response);
        }
Exemple #5
0
        public async Task GetDistinctProductComposition()
        {
            GarmentProduct model = await DataUtil.GetTestDataAsync();

            var Response = Services.GetDistinctProductComposition(model.Composition, "{\"Composition\":\"test\"}");

            Assert.NotNull(Response);
        }
Exemple #6
0
        public async Task Should_Success_Create_Data()
        {
            GarmentProduct model1 = await DataUtil.GetTestDataAsync();

            GarmentProduct model2   = DataUtil.GetNewData2();
            var            Response = Services.Create(model2);

            Assert.NotEqual(Response, 0);
        }
Exemple #7
0
        public async Task Should_Success_Get_Data_By_Code()
        {
            GarmentProduct model1 = await DataUtil.GetTestDataAsync();

            GarmentProduct model2 = await DataUtil.GetTestDataAsync();

            var codes    = string.Format("{0},{1}", model1.Code, model2.Code);
            var Response = Services.GetByCode(codes);

            Assert.NotNull(Response);
        }
        public async void Should_Success_Get_Data_By_Id()
        {
            GarmentProduct model1 = await DataUtil.GetTestDataAsync();

            GarmentProduct model2 = await DataUtil.GetTestDataAsync();

            var Response = Services.GetByIds(new List <int> {
                model1.Id, model2.Id
            });

            Assert.NotNull(Response);
        }
        public async void Should_Error_Create_Data_With_Same_Combination_of_Composition()
        {
            GarmentProduct model1 = await DataUtil.GetTestDataAsync2();

            try
            {
                await DataUtil.GetTestDataAsync2();
            }
            catch (ServiceValidationExeption ex)
            {
                Assert.Equal(ex.Message, "Validation Error");
            }
        }