本文整理汇总了C#中Production.AddProductionShift方法的典型用法代码示例。如果您正苦于以下问题:C# Production.AddProductionShift方法的具体用法?C# Production.AddProductionShift怎么用?C# Production.AddProductionShift使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Production
的用法示例。
在下文中一共展示了Production.AddProductionShift方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddShiftsOnDifferentDaysWithSameTeam
public void AddShiftsOnDifferentDaysWithSameTeam()
{
Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
ProductionTeam team = new ProductionTeam("Team 1");
DateTime start1 = new DateTime(2008, 10, 12, 8, 30, 0);
DateTime start2 = new DateTime(2008, 11, 12, 8, 30, 0);
ProductionShift shift1 = production.AddProductionShift(team, start1);
ProductionShift shift2 = production.AddProductionShift(team, start2);
CollectionAssert.AreEquivalent(new [] { shift1, shift2 }, new List<ProductionShift>(production.Shifts));
}
示例2: AddShift
public void AddShift()
{
Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
ProductionTeam team = new ProductionTeam("Team 1");
DateTime start = new DateTime(2008, 10, 12, 8, 30, 0);
ProductionShift shift = production.AddProductionShift(team, start);
CollectionAssert.AreEquivalent(new [] { shift }, new List<ProductionShift>(production.Shifts));
}
示例3: CreateProductionLeg
public void CreateProductionLeg()
{
Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
ProductionTeam team = new ProductionTeam("Team");
DateTime start = new DateTime(2008, 10, 12, 8, 30, 0);
ProductionShift shift = production.AddProductionShift(team, start.Date);
long counterStart = 9956;
ProductionLeg leg = shift.AddProductionLeg(start, counterStart);
Assert.AreEqual<DateTime>(start, leg.ProductionStart);
Assert.AreEqual<long>(counterStart, leg.CounterStart);
}
示例4: AddStopsToProductionLeg
public void AddStopsToProductionLeg()
{
Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
ProductionLeg leg = shift.AddProductionLeg(DateTime.Now, 0);
CollectionAssert.AreEquivalent(new ProductionStopRegistration[] { }, new List<ProductionStopRegistration>(leg.ProductionStopRegistrations));
leg.AddProductionStopRegistration(new ProductionStopRegistration(stop1, new TimeSpan(0, 10, 0)));
CollectionAssert.AreEquivalent(new [] { new ProductionStopRegistration(stop1, new TimeSpan(0, 10, 0)) }, new List<ProductionStopRegistration>(leg.ProductionStopRegistrations));
leg.AddProductionStopRegistration(new ProductionStopRegistration(stop3, new TimeSpan(0, 35, 0)));
CollectionAssert.AreEquivalent(new [] { new ProductionStopRegistration(stop1, new TimeSpan(0, 10, 0)), new ProductionStopRegistration(stop3, new TimeSpan(0, 35, 0)) }, new List<ProductionStopRegistration>(leg.ProductionStopRegistrations));
leg.AddProductionStopRegistration(new ProductionStopRegistration(stop1, new TimeSpan(0, 12, 0)));
CollectionAssert.AreEquivalent(new [] { new ProductionStopRegistration(stop1, new TimeSpan(0, 10, 0)), new ProductionStopRegistration(stop1, new TimeSpan(0, 12, 0)), new ProductionStopRegistration(stop3, new TimeSpan(0, 35, 0)) }, new List<ProductionStopRegistration>(leg.ProductionStopRegistrations));
}
示例5: UpdateProductionShifts
public void UpdateProductionShifts()
{
Production production = new Production("Machine A", product1, order1, 1000, 100);
using (IEntityRepository<Production> repository = factory.CreateEntityRepository<Production>())
{
repository.Save(production);
}
ProductionShift shift1 = production.AddProductionShift(team1, new DateTime(2008, 11, 12));
ProductionShift shift2 = production.AddProductionShift(team2, new DateTime(2008, 11, 12));
using (IEntityRepository<ProductionShift> repository = factory.CreateEntityRepository<ProductionShift>())
{
repository.Save(shift1);
repository.Save(shift2);
}
using (IEntityRepository<Production> repository = factory.CreateEntityRepository<Production>())
{
repository.Save(production);
}
using (IEntityRepository<Production> repository = factory.CreateEntityRepository<Production>())
{
Production loadedProduction = repository.Load(production.Id);
Assert.AreNotSame(production, loadedProduction);
Assert.AreEqual(production, loadedProduction);
Assert.AreEqual(production.Machine, loadedProduction.Machine);
Assert.AreEqual(production.Product, loadedProduction.Product);
Assert.AreEqual(production.Order, loadedProduction.Order);
Assert.AreEqual(production.ExpectedItems, loadedProduction.ExpectedItems);
Assert.AreEqual(production.ProducedItemsPerHour, loadedProduction.ProducedItemsPerHour);
CollectionAssert.AreEquivalent(new List<ProductionShift>(production.Shifts), new List<ProductionShift>(loadedProduction.Shifts));
}
}
示例6: AddShiftsOnSameDayWithSameTeam
public void AddShiftsOnSameDayWithSameTeam()
{
Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
ProductionTeam team = new ProductionTeam("Team 1");
DateTime start = new DateTime(2008, 10, 12, 8, 30, 0);
ProductionShift shift1 = production.AddProductionShift(team, start);
ProductionShift shift2 = production.AddProductionShift(team, start.AddHours(1));
}
示例7: Duplicate
private Production Duplicate(Production p, IEnumerable<ProductionShift> shifts)
{
Production production = new Production(p.Machine, p.Product, p.Order,
p.ExpectedItems,
p.ProducedItemsPerHour,
p.ValidatedStartTime);
foreach (var shift in shifts)
{
var s = production.AddProductionShift(shift.Team, shift.ProductionStart.Date);
foreach (var leg in shift.ProductionLegs)
{
var l = s.AddProductionLeg(leg.ProductionStart, leg.CounterStart);
foreach (var registration in shift.ProductionStopRegistrations)
{
l.AddProductionStopRegistration(registration);
}
l.UpdateStatistics(leg.ProductionEnd, leg.CounterEnd, leg.DiscardedItems);
}
}
return production;
}
示例8: CreateWithNegativeCounterStart
public void CreateWithNegativeCounterStart()
{
DateTime time = DateTime.Now;
Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
ProductionLeg leg = shift.AddProductionLeg(DateTime.Now, -1);
}
示例9: UpdateWithProductionStartSameAsProductionEnd
public void UpdateWithProductionStartSameAsProductionEnd()
{
DateTime time = DateTime.Now;
Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
ProductionLeg leg = shift.AddProductionLeg(time, 0);
leg.UpdateStatistics(time, 0, 0);
}
示例10: UpdateWithNegativeDiscarded
public void UpdateWithNegativeDiscarded()
{
DateTime time = DateTime.Now;
Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
ProductionLeg leg = shift.AddProductionLeg(time, 0);
leg.UpdateStatistics(time.AddMinutes(10), 50, -5);
}
示例11: UpdateWithCounterEndSmallerThanCounterStart
public void UpdateWithCounterEndSmallerThanCounterStart()
{
DateTime time = DateTime.Now;
Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
ProductionLeg leg = shift.AddProductionLeg(time, 400);
leg.UpdateStatistics(time.AddMinutes(10), 300, 0);
}
示例12: ProductionStatistics
public void ProductionStatistics()
{
DateTime start = new DateTime(2008, 10, 12, 8, 30, 0);
DateTime end = new DateTime(2008, 10, 12, 14, 45, 0);
long counterStart = 1111;
long counterEnd = 12342;
long discardedItems = 534;
Production production = new Production("Machine A", new ProductNumber("11232"), new OrderNumber("1234"), 1000, 124);
ProductionShift shift = production.AddProductionShift(new ProductionTeam("T"), DateTime.Now.Date);
ProductionLeg leg = shift.AddProductionLeg(start, counterStart);
leg.UpdateStatistics(end, counterEnd, discardedItems);
Assert.AreEqual<long>(11231, leg.ProducedItems);
Assert.AreEqual<long>(10697, leg.ProducedApprovedItems);
Assert.AreEqual<TimeSpan>(new TimeSpan(6, 15, 0), leg.ProductionTime);
}