public FrmEstimationList() { InitializeComponent(); GvContext = this.gvEstimation; estimationData = new Estimation(); FormatData(); PrivateSearch(); }
public static void Populate(Estimation estimation) { // liste des estimations qui on beusoin de se faire peupler (leurs liste utilisateurs) if (!EstimationAlreadyInDictionary(estimation.IdEstimation)) { GetEstimationById(estimation.IdEstimation); } estimation.CommissaireEstimation = _estimationsDictionary[estimation.IdEstimation].CommissaireEstimation; estimation.ProduitEstimation = _estimationsDictionary[estimation.IdEstimation].ProduitEstimation; }
public void Estimation_SetToNotAvailableValue_ArgumentException() { // Arrange var team = new ScrumTeam("test team"); var master = team.SetScrumMaster("master"); master.StartEstimation(); var masterEstimation = new Estimation(44.0); // Act Assert.ThrowsException <ArgumentException>(() => master.Estimation = masterEstimation); }
public void Equals_3point6And3point6_ReturnsTrue() { // Arrange var target = new Estimation(3.6); var estimation2 = new Estimation(3.6); // Act var result = target.Equals(estimation2); // Verify Assert.IsTrue(result); }
public void Equals_PositiveInfinityAndPositiveInfinity_ReturnsTrue() { // Arrange var target = new Estimation(double.PositiveInfinity); var estimation2 = new Estimation(double.PositiveInfinity); // Act var result = target.Equals(estimation2); // Verify Assert.IsTrue(result); }
public void Equals_ZeroAndNaN_ReturnsFalse() { // Arrange var target = new Estimation(); var estimation2 = new Estimation(double.NaN); // Act var result = target.Equals(estimation2); // Verify Assert.IsFalse(result); }
private static void ReadLines(Estimation estimation, XElement node) { foreach (XElement lineNode in node.NsElements("line")) { Line line = new Line(); line.StartX = ReadAttribute(lineNode, "x1"); line.StartY = ReadAttribute(lineNode, "y1"); line.EndX = ReadAttribute(lineNode, "x2"); line.EndY = ReadAttribute(lineNode, "y2"); estimation.Geometries.Add(line); } }
public void IndexerSet_MemberNotInResult_KeyNotFoundException() { // Arrange var team = new ScrumTeam("test team"); var master = team.SetScrumMaster("master"); var member = (Member)team.Join("member", false); var target = new EstimationResult(new Member[] { master }); var estimation = new Estimation(); // Act target[member] = estimation; }
private static void ReadRectangles(Estimation estimation, XElement node) { foreach (XElement rectangleNode in node.NsElements("rect")) { Rectangle rect = new Rectangle(); rect.StartX = ReadAttribute(rectangleNode, "x"); rect.StartY = ReadAttribute(rectangleNode, "y"); rect.Width = ReadAttribute(rectangleNode, "width"); rect.Height = ReadAttribute(rectangleNode, "height"); estimation.Geometries.Add(rect); } }
public void Equals_ZeroAndZero_ReturnsTrue() { // Arrange var target = new Estimation(0.0); var estimation2 = new Estimation(0.0); // Act var result = target.Equals(estimation2); // Verify Assert.IsTrue(result); }
private static void ReadImage(Estimation estimation, XElement node) { foreach (XElement imageNode in node.NsElements("image")) { Image image = new Image(); image.X = ReadAttribute(imageNode, "x"); image.Y = ReadAttribute(imageNode, "y"); image.Width = ReadAttribute(imageNode, "width"); image.Height = ReadAttribute(imageNode, "height"); estimation.Geometries.Add(image); } }
private static void ReadEllipse(Estimation estimation, XElement node) { foreach (XElement ellipseNode in node.NsElements("ellipse")) { Ellipse ellipse = new Ellipse(); ellipse.X = ReadAttribute(ellipseNode, "cx"); ellipse.Y = ReadAttribute(ellipseNode, "cy"); ellipse.XRadius = ReadAttribute(ellipseNode, "rx"); ellipse.YRadius = ReadAttribute(ellipseNode, "ry"); estimation.Geometries.Add(ellipse); } }
public void Equals_NullEstimations_ReturnsTrue() { // Arrange var target = new Estimation(); var estimation2 = new Estimation(null); // Act var result = target.Equals(estimation2); // Verify Assert.IsTrue(result); }
public void Equals_6And2_ReturnsFalse() { // Arrange var target = new Estimation(6); var estimation2 = new Estimation(2); // Act var result = target.Equals(estimation2); // Verify Assert.IsFalse(result); }
public void Estimation_SetToNotAvailableValueWithFibonacciValues_ArgumentException() { // Arrange var availableEstimations = DeckProvider.Default.GetDeck(Deck.Fibonacci); var team = ScrumTeamTestData.CreateScrumTeam("test team", availableEstimations: availableEstimations); var master = team.SetScrumMaster("master"); master.StartEstimation(); var masterEstimation = new Estimation(40.0); // Act Assert.ThrowsException <ArgumentException>(() => master.Estimation = masterEstimation); }
public void ReadSvcInfo_ReadsMultipleElements() { //Arrange string fileName = "Complex.svg"; string path = SaveToDisk(fileName, Resources.Resources.Complex); var estimation = new Estimation(path); //Act InfoReadingManager.ReadSvcInfo(estimation); //Assert Assert.AreEqual(19, estimation.Geometries.Count); }
public void IndexerSet_IsReadOnly_InvalidOperationException() { // Arrange var team = new ScrumTeam("test team"); var master = team.SetScrumMaster("master"); var member = (Member)team.Join("member", false); var target = new EstimationResult(new Member[] { master, member }); var estimation = new Estimation(); // Act target.SetReadOnly(); target[member] = estimation; }
/// <summary> /// Selects estimation by user, when estimation is in progress. /// </summary> /// <param name="estimation">Selected estimation value.</param> /// <returns><see cref="Task"/> representing asynchronous operation.</returns> public async Task SelectEstimation(double?estimation) { if (CanSelectEstimation) { using (_busyIndicator.Show()) { var selectedEstimation = ScrumTeam.AvailableEstimations.First(e => e.Value == estimation); await _planningPokerService.SubmitEstimation(TeamName, User.Name, estimation, CancellationToken.None); _selectedEstimation = selectedEstimation; } } }
public void Estimation_SetToNotAvailableValueWithCustomValues_ArgumentException() { // Arrange var availableEstimations = ScrumTeamTestData.GetCustomEstimationDeck(); var team = ScrumTeamTestData.CreateScrumTeam("test team", availableEstimations: availableEstimations); var master = team.SetScrumMaster("master"); master.StartEstimation(); var masterEstimation = new Estimation(double.PositiveInfinity); // Act Assert.ThrowsException <ArgumentException>(() => master.Estimation = masterEstimation); }
public void Estimation_SetTwiceToDifferentValues_InvalidOperationException() { // Arrange var team = new ScrumTeam("test team"); var estimation1 = new Estimation(); var estimation2 = new Estimation(); var target = new Member(team, "test"); target.Estimation = estimation1; // Act target.Estimation = estimation2; }
public void BuildDto() { foreach (var productWatcher in gathered) { estimation = new Estimation(); if (estimation.products == null) { estimation.products = new List <Product>(); } estimation.products.Add(productWatcher.getProduct()); estimation.totalPrice = estimation.products.Select(e => e.price).Sum(); SaveEstimation(estimation, path); } }
public void CanEstimateInCurrentRound() { const string player = "p1"; var game = new Game(player); game.NewRound("subj", player); var e = new Estimation(EstimationValue.One, player); Assert.IsType <Success>(game.Estimate(e)); var round = game.Rounds.Single(); Assert.Equal(e, round.Estimations.Single()); }
/// <summary> /// Constructeur /// </summary> /// <param name="nav"></param> public ViewModelEstimationPage(INavigation nav) { _Navigation = nav; _Client = new Client(); Estimation = new Estimation(); _Produits = new ObservableCollection <Produit>(); EstimationSelectVerif = false; _EstimationPlusCommand = new DelegateCommand(ExecuteEstimationPlusCommand); _ProduitUtiliseCommand = new DelegateCommand(ExecuteProduitUtiliseCommand); _EstimerCommand = new DelegateCommand(ExecuteEstimerCommand); }
public JsonResult AddEstimation(string payment, double price, int payerid, string datecreated) { var creatorId = int.Parse(Session["UserId"] + string.Empty); int roomid = int.Parse(Session["roomID"] + string.Empty); var newEstimation = new Estimation { Payment = payment, Price = price, DateCreated = datecreated }; return(Json(GraphDatabaseHelpers.Instance.InsertEstimation(newEstimation, roomid, creatorId, payerid))); }
private static void ReadGeometries(Estimation estimation, XElement node) { ReadLines(estimation, node); ReadRectangles(estimation, node); ReadCircles(estimation, node); ReadEllipse(estimation, node); ReadImage(estimation, node); ReadPath(estimation, node); ReadPolygon(estimation, node); ReadPolyLine(estimation, node); ReadText(estimation, node); ReadGroups(estimation, node); }
public void Estimation_SetAndGet_ReturnsTheValue() { // Arrange var team = new ScrumTeam("test team"); var estimation = new Estimation(); var target = new Member(team, "test"); // Act target.Estimation = estimation; var result = target.Estimation; // Verify Assert.AreEqual <Estimation>(estimation, result); }
public void Estimation_SetOnMemberOnly_EstimationResultIsNull() { // Arrange var team = new ScrumTeam("test team"); var master = team.SetScrumMaster("master"); var member = (Member)team.Join("member", false); master.StartEstimation(); var memberEstimation = new Estimation(); // Act member.Estimation = memberEstimation; // Verify Assert.IsNull(team.EstimationResult); }
public void Estimation_SetOnMemberOnly_StateIsEstimationInProgress() { // Arrange var team = new ScrumTeam("test team"); var master = team.SetScrumMaster("master"); var member = (Member)team.Join("member", false); master.StartEstimation(); var masterEstimation = new Estimation(); // Act master.Estimation = masterEstimation; // Verify Assert.AreEqual <TeamState>(TeamState.EstimationInProgress, team.State); }
public void DifferentPlayersCanAddEstimates() { var game = new Game("p1"); game.NewRound("subj", "p1"); var e1 = new Estimation(EstimationValue.One, "p1"); Assert.IsType <Success>(game.Estimate(e1)); var e2 = new Estimation(EstimationValue.One, "p2"); Assert.IsType <Success>(game.Estimate(e2)); Assert.True(game.Rounds.Single().Estimations.SequenceEqual(new[] { e1, e2 })); }
public void Estimation_SetTwiceAndGet_ReturnsTheValue() { // Arrange var availableEstimations = DeckProvider.Default.GetDeck(Deck.Fibonacci); var team = ScrumTeamTestData.CreateScrumTeam("test team", availableEstimations: availableEstimations); var estimation = new Estimation(21); var target = new Member(team, "test"); // Act target.Estimation = estimation; target.Estimation = estimation; var result = target.Estimation; // Verify Assert.AreEqual <Estimation>(estimation, result); }
public static void Estimate(Estimation estimation) { EstimationResult result = new EstimationResult(); foreach (GeometryType geometryType in Enum.GetValues(typeof(GeometryType))) { int totalCount, uniqueCount; Count(estimation.Geometries, geometryType, out totalCount, out uniqueCount); result.SetCount(geometryType, totalCount); result.SetUniqueCount(geometryType, uniqueCount); } result.CharCount = CountChars(estimation.Geometries); result.ComplexObjectPointCount = CountPoints(estimation.Geometries); estimation.Result = result; }
/// <summary> /// Handles the Click event of the mnuItemDelete control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// Created by SMK private void mnuItemDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Bạn chắc muốn xoá ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No) return; if (gvEstimation.Row >= 0) { var guid = (Guid)gvEstimation.Rows[gvEstimation.Row]["Id"]; // Delete chil first var dataItem = new EstimationItem(Config.ConnectionString); dataItem.Delete(guid); // Delete parent later var data = new Estimation(Config.ConnectionString); data.Delete(guid); gvEstimation.Rows.Remove(gvEstimation.Row); } }