Skip to content

Instantly share code, notes, and snippets.

@MarcoNicolodi
Created January 13, 2019 14:30
Show Gist options
  • Save MarcoNicolodi/3299cdc96c41b51443ce7bca8b7c09ff to your computer and use it in GitHub Desktop.
Save MarcoNicolodi/3299cdc96c41b51443ce7bca8b7c09ff to your computer and use it in GitHub Desktop.
Flaky unit test suite
var elaboration = new Stage() { Type = StageType.Elaboration, Name = "Elaboration" };
var approval = new Stage() { Type = StageType.Approval, Name = "Approval" };
var consensus = new Stage() { Type = StageType.Approval, Name = "Consensus" };
context.Stages.Add(elaboration);
context.Stages.Add(approval);
context.Stages.Add(consensus);
var oldCategory = new Category()
{
Initials = "CAT",
Name = "Category",
Stages = new List<CategoryStage>() {
new CategoryStage() { Order = 1, Stage = elaboration },
new CategoryStage() { Order = 2, Stage = approval },
},
};
var newCategory = new Category()
{
Initials = "DOG",
Name = "Dogcary",
Stages = new List<CategoryStage>() {
new CategoryStage() { Order = 1, Stage = elaboration },
new CategoryStage() { Order = 2, Stage = consensus },
}
};
context.Categories.Add(oldCategory);
context.Categories.Add(newCategory);
var document = new Document()
{
CategoryId = oldCategory.Id,
SuggestedCode = new SuggestedCode() { Code = 5, DocumentId = 1 },
ProcessId = 1,
Title = "Arroz",
Code = "Codecept",
Stages = new List<DocumentStage>() {
new DocumentStage() {
StageId = elaboration.Id,
Responsibles = new List<DocumentStageResponsible>()
{
new DocumentStageResponsible() { ResponsibleId = 113 },
},
},
new DocumentStage()
{
StageId = approval.Id,
Responsibles = new List<DocumentStageResponsible>()
{
new DocumentStageResponsible() { ResponsibleId = 113 },
new DocumentStageResponsible() { ResponsibleId = 117 },
},
},
},
Revisions = new List<Revision>()
{
new Revision() {
Stages = new List<RevisionStage>(),
PublishDate = DateTime.Now,
RevisionRequestHistory = new List<RevisionRequest>()
},
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment