public void SwapWith(GreigeRoll other) { (other.RollNo, this.RollNo) = (this.RollNo, other.RollNo); (other.OrderNo, this.OrderNo) = (this.OrderNo, other.OrderNo); (other.StyleCode, this.StyleCode) = (this.StyleCode, other.StyleCode); (other.StyleName, this.StyleName) = (this.StyleName, other.StyleName); (other.ColorCode, this.ColorCode) = (this.ColorCode, other.ColorCode); (other.ColorName, this.ColorName) = (this.ColorName, other.ColorName); (other.BackingCode, this.BackingCode) = (this.BackingCode, other.BackingCode); (other.RollLength, this.RollLength) = (this.RollLength, other.RollLength); (other.RollWidth, this.RollWidth) = (this.RollWidth, other.RollWidth); (other.DefaultRecipe, this.DefaultRecipe) = (this.DefaultRecipe, other.DefaultRecipe); (other.PatternRepeatLength, this.PatternRepeatLength) = (this.PatternRepeatLength, other.PatternRepeatLength); (other.ProductImageURL, this.ProductImageURL) = (this.ProductImageURL, other.ProductImageURL); }
/// <summary> /// Copy all but RollId to the destination /// </summary> /// <param name="dest"></param> public void CopyTo(GreigeRoll dest) { if (dest == null) { throw new NullReferenceException(); } //dest.GridImage = this.GridImage; dest.RollNo = this.RollNo; dest.OrderNo = this.OrderNo; dest.StyleCode = this.StyleCode; dest.StyleName = this.StyleName; dest.ColorCode = this.ColorCode; dest.ColorName = this.ColorName; dest.BackingCode = this.BackingCode; dest.RollLength = this.RollLength; dest.RollWidth = this.RollWidth; dest.DefaultRecipe = this.DefaultRecipe; dest.PatternRepeatLength = this.PatternRepeatLength; dest.ProductImageURL = this.ProductImageURL; }
public MeterLogicTests() { const int roll1Length = 100; const int roll2Length = 200; const int roll3Length = 300; const int roll4Length = 400; const int roll5Length = 400; const int roll6Length = 400; const int roll7Length = 400; this.srcData = new MockMeterSrc <MahloModel>(); this.sewinQueue = Substitute.For <ISewinQueue>(); this.dbMfg = Substitute.For <IDbMfg>(); this.dbLocal = Substitute.For <IDbLocal>(); this.appInfo = Substitute.For <IServiceSettings>(); this.userAttentions = Substitute.For <IUserAttentions <MahloModel> >(); this.criticalStops = Substitute.For <ICriticalStops <MahloModel> >(); this.appInfo.MinRollLengthForStyleAndRollCounting = 1; this.appInfo.MinRollLengthForLengthChecking = 1; var stateProvider = Substitute.For <IProgramStateProvider>(); stateProvider.GetProgramState().Returns("{}"); this.programState = new ProgramState(stateProvider); var roll1 = new MahloService.Models.GreigeRoll() { Id = 1, RollNo = "12345", RollLength = roll1Length, }; var roll2 = new MahloService.Models.GreigeRoll() { Id = 2, RollNo = "12346", RollLength = roll2Length, }; var roll3 = new MahloService.Models.GreigeRoll() { Id = 3, RollNo = "12347", RollLength = roll3Length, }; var roll4 = new MahloService.Models.GreigeRoll() { Id = 4, RollNo = "12348", RollLength = roll4Length, }; var roll5 = new MahloService.Models.GreigeRoll() { Id = 5, RollNo = "12349", RollLength = roll5Length, }; var roll6 = new MahloService.Models.GreigeRoll() { Id = 6, RollNo = "12350", RollLength = roll6Length, }; var roll7 = new MahloService.Models.GreigeRoll() { Id = 7, RollNo = "12351", RollLength = roll7Length, }; this.greigeRolls = new List <GreigeRoll> { roll1, roll2, roll3, roll4, roll5, roll6, roll7 }; this.sewinQueue.Rolls.Returns(new BindingList <GreigeRoll>(this.greigeRolls)); this.target = new MahloLogic(this.dbLocal, this.srcData, this.sewinQueue, this.appInfo, this.userAttentions, this.criticalStops, this.programState, this.testSchedulers) { CurrentRoll = this.sewinQueue.Rolls[0] }; this.sewinQueue.QueueChanged += Raise.Event <Action>(); Assert.True(this.userAttentions.VerifyRollSequence); Assert.NotNull(this.target.CurrentRoll); this.userAttentions.ClearAll(); this.target.Start(); }