Exemplo n.º 1
0
        public async void MaterialColourUpdate()
        {
            // Arrange
            this.QuarryDbContext.MaterialColours.AddRange(
                    new MaterialColourEntity() { MaterialColourId = 1, ColourName = "White", CompanyId = 1, DeletedInd = false },
                    new MaterialColourEntity() { MaterialColourId = 2, ColourName = "Smoky", CompanyId = 1, DeletedInd = false });
            await this.SaveChangesAsync(this.QuarryDbContext);

            MaterialColourModel model = new MaterialColourModel() { MaterialColourId = 2, ColourName = "Grey" };

            // Act
            AjaxModel<NTModel> ajaxModel = await this.Controller.MaterialColourUpdate(model);

            // Assert
            MaterialColourEntity entity = this.QuarryDbContext.MaterialColours.Where(e => e.MaterialColourId == 2).First();
            Assert.Equal(entity.ColourName, "Grey");
            Assert.Equal(ajaxModel.Message, QuarryMessages.MaterialColourSaveSuccess);
        }
Exemplo n.º 2
0
 public async Task MaterialColourSave(MaterialColourModel model)
 {
     await this.quarryRepository.MaterialColourSave(model);
 }
Exemplo n.º 3
0
        public async void MaterialColourAdd()
        {
            // Arrange
            MaterialColourModel model = new MaterialColourModel() { MaterialColourId = 0, ColourName = "Grey" };

            // Act
            AjaxModel<NTModel> ajaxModel = await this.Controller.MaterialColourAdd(model);

            // Assert
            MaterialColourEntity entity = this.QuarryDbContext.MaterialColours.Last();
            Assert.Equal(entity.ColourName, "Grey");
            Assert.Equal(ajaxModel.Message, QuarryMessages.MaterialColourSaveSuccess);
        }