public void Should_Success_Instantiate() { MachineEventViewModel viewModel = new MachineEventViewModel() { Code = "Code", Name = "Name", No = "No", Category = "Category" }; Assert.Equal("Code", viewModel.Code); Assert.Equal("Name", viewModel.Name); Assert.Equal("No", viewModel.No); Assert.Equal("Category", viewModel.Category); }
public void Should_Success_Instantiate() { var time = DateTimeOffset.Now; var machineViewModel = new MachineViewModel() { UId = "UId", Code = "Code" }; var production = new ProductionOrderIntegrationViewModel() { }; var productionOrderDetail = new ProductionOrderDetailIntegrationViewModel(); var machineEvent = new MachineEventViewModel(); MonitoringEventViewModel viewModel = new MonitoringEventViewModel() { UId = "UId", CartNumber = "CartNumber", Code = "Code", DateStart = time, DateEnd = time, TimeInMilisStart = 1, TimeInMilisEnd = 1, Remark = "Remark", Machine = machineViewModel, ProductionOrder = production, ProductionOrderDetail = productionOrderDetail, MachineEvent = machineEvent, }; Assert.Equal("UId", viewModel.UId); Assert.Equal("CartNumber", viewModel.CartNumber); Assert.Equal("Code", viewModel.Code); Assert.Equal(time, viewModel.DateStart); Assert.Equal(time, viewModel.DateEnd); Assert.Equal(1, viewModel.TimeInMilisStart); Assert.Equal(1, viewModel.TimeInMilisEnd); Assert.Equal("Remark", viewModel.Remark); Assert.Equal("Remark", viewModel.Remark); Assert.Equal(machineViewModel, viewModel.Machine); Assert.Equal(production, viewModel.ProductionOrder); Assert.Equal(productionOrderDetail, viewModel.ProductionOrderDetail); Assert.Equal(machineEvent, viewModel.MachineEvent); }
public void validate_Throws_NotImplementedException() { MachineEventViewModel viewModel = new MachineEventViewModel(); Assert.Throws <NotImplementedException>(() => viewModel.Validate(null)); }