-
Notifications
You must be signed in to change notification settings - Fork 0
/
UserStoryEstimation.cs
117 lines (110 loc) · 3.69 KB
/
UserStoryEstimation.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PlaygilePlayground
{
public class UserStoryEstimation
{
private MainForm _mainForm;
public UserStoryEstimation(MainForm mainForm)
{
_mainForm = mainForm;
}
public UserStoryScore CalculateScore()
{
int result = 0;
double demostrableScore;
if ((string)_mainForm.comboBoxDemonstrable.SelectedItem == @"Demonstrable")
{
demostrableScore = 10.0;
}
else
{
demostrableScore = 0;
}
result += (int)demostrableScore;
double acceptanceScore;
if ((string)_mainForm.comboBoxAcceptanceCriteria.SelectedItem == @"Present")
{
acceptanceScore = 20.0;
}
else
{
acceptanceScore = 0;
}
result += (int)acceptanceScore;
double collateralMaterialsAvailabilityScore;
if ((string)_mainForm.comboBoxCollateralMaterialsAvailability.SelectedItem == @"Available")
{
collateralMaterialsAvailabilityScore = 25.0 / 2.0 * 2;
}
else if ((string)_mainForm.comboBoxCollateralMaterialsAvailability.SelectedItem == @"Will be provided in sprint")
{
collateralMaterialsAvailabilityScore = 25.0 / 2.0 * 1;
}
else collateralMaterialsAvailabilityScore = 0;
result += (int)collateralMaterialsAvailabilityScore;
double estimableScore;
if ((string)_mainForm.comboBoxEstimable.SelectedItem == @"Regular story (1-5 story points)")
{
estimableScore = 20.0 / 2.0 * 2;
}
else if ((string)_mainForm.comboBoxEstimable.SelectedItem == @"Large story(8 - 13 story points)")
{
estimableScore = 20.0 / 2.0 * 1;
}
else estimableScore = 0;
result += (int)estimableScore;
double splittableScore;
if ((string)_mainForm.comboBoxSplittable.SelectedItem == @"Can be splitted")
{
splittableScore = 25.0;
}
else
{
splittableScore = 0;
}
result += (int)splittableScore;
Color tmpBackgroundColor;
Color tmpForegroundColor;
if (result < 50)
{
tmpForegroundColor = Color.YellowGreen;
tmpBackgroundColor = Color.Red;
}
else
{
if (result < 70)
{
tmpForegroundColor = Color.YellowGreen;
tmpBackgroundColor = Color.Orange;
}
else
{
if (result < 100)
{
tmpForegroundColor = Color.YellowGreen;
tmpBackgroundColor = Color.Blue;
}
else
{
tmpForegroundColor = Color.Yellow;
tmpBackgroundColor = Color.Blue;
}
}
}
UserStoryScore score = new UserStoryScore()
{ backgroundColor = tmpBackgroundColor, foregroundColor = tmpForegroundColor, Score = result.ToString() };
return score;
}
}
public class UserStoryScore
{
public Color foregroundColor;
public Color backgroundColor;
public string Score;
}
}