Ejemplo n.º 1
0
 private void When(IssueCreated e)
 {
     _id          = new IssueId(e.issueId);
     ProductId    = new ProductId(e.productId);
     _state       = State.Pending;
     _type        = (IssueType)Enum.Parse(typeof(IssueType), e.issueType);
     _description = e.description;
     _summary     = e.summary;
 }
Ejemplo n.º 2
0
 public IssueCreated(
     TenantId tenantId1,
     IssueId issueId1,
     ProductId productId1,
     string description1,
     string summary1,
     IssueType issueType)
 {
     // TODO: Complete member initialization
     this.tenantId    = tenantId1.ToString();
     this.issueId     = issueId1.ToString();
     this.productId   = productId1.ToString();
     this.description = description1.ToString();
     this.summary     = summary1.ToString();
     this.issueType   = issueType.ToString();
 }
Ejemplo n.º 3
0
        static void Main()
        {
            //Make sure you start an instance of EventStore before running this!!
            var credentials = new UserCredentials("admin", "changeit");
            var connection = EventStoreConnection.Create(
                ConnectionSettings.Create().
                    UseConsoleLogger().
                    SetDefaultUserCredentials(
                        credentials),
                new IPEndPoint(IPAddress.Loopback, 1113),
                "EventStoreShopping");
            connection.Connect();

            var productUow = new UnitOfWork();
            var productRepository = new Repository<Product>(
                Product.Factory,
                productUow,
                connection,
                new EventReaderConfiguration(
                    new SliceSize(512),
                    new JsonDeserializer(),
                    new PassThroughStreamNameResolver(),
                    new FixedStreamUserCredentialsResolver(credentials)));

            var tenantId = new TenantId(Guid.NewGuid().ToString());
            var productId = new ProductId();
            productRepository.Add(productId.ToString(),
                new Product(tenantId,
                    productId,
                    "dolphin-tuna",
                    "non-dolphin free",
                    new ProductManager(Guid.NewGuid().ToString()),
                    new IssueAssigner(Guid.NewGuid().ToString())));

            var product = productRepository.Get(productId.ToString());

            List<Issue> issues = new List<Issue>();
            var issueId = new IssueId();
            issues.Add(product.ReportDefect(issueId, "shit be bad yo", "fo real"));
            issues.Add(product.ReportDefect(new IssueId(), "shit be bad yo", "fo real"));
            issues.Add(product.ReportDefect(new IssueId(), "shit be bad yo", "fo real"));
            issues.Add(product.ReportDefect(new IssueId(), "shit be bad yo", "fo real"));
            issues.Add(product.ReportDefect(new IssueId(), "shit be bad yo", "fo real"));

            DefectStatistics stats1 = new DefectStatistics(issues);

            var release1 = product.ScheduleRelease("new relased", stats1);

            var density = release1.CalculateDefectDensity(new KlocMEasurement(10));

            issues.Add(product.ReportDefect(new IssueId(), "shit be bad yo", "fo real"));
            issues.Add(product.ReportDefect(new IssueId(), "shit be bad yo", "fo real"));

            issues.First().Resolve("cool");

            DefectStatistics stats2 = new DefectStatistics(issues);

            var release2 = product.ScheduleRelease("new relased", stats2);

            var density2 = release2.CalculateDefectDensity(new KlocMEasurement(10));

            var product2 = productRepository.Get(productId.ToString());

            var issueIdForProduct2 = new IssueId();
            issues.Add(product2.ReportDefect(issueIdForProduct2, "shit be bad yo", "fo real"));
            issues.Add(product2.ReportDefect(new IssueId(), "shit be bad yo", "fo real"));
            issues.Add(product2.ReportDefect(new IssueId(), "shit be bad yo", "fo real"));
            issues.Add(product2.ReportDefect(new IssueId(), "shit be bad yo", "fo real"));
            issues.Add(product2.ReportDefect(new IssueId(), "shit be bad yo", "fo real"));

            ProductDefectivenessRanker ranker = new ProductDefectivenessRanker(issues);

            ProductDefectiveness mostDefective = ranker.MostDefectiveProductFrom(tenantId);
        }
Ejemplo n.º 4
0
 public IssueFixed(IssueId _id, string resolution)
 {
     // TODO: Complete member initialization
     this._id = _id;
     this.resolution = resolution;
 }
Ejemplo n.º 5
0
 public Issue(TenantId tenantId, IssueId issueId, ProductId productId, string description, string summary, IssueType type)
     : this()
 {
     ApplyChange(new IssueCreated(tenantId, issueId, productId, description, summary, type));
 }
Ejemplo n.º 6
0
 public Issue RequestFeature(IssueId issueId, string descrption, string summary)
 {
     return new Issue(_tenantId, issueId, _id, description, summary, IssueType.Feature);
 }
Ejemplo n.º 7
0
 public Issue ReportDefect(IssueId issueId, string descrption, string summary)
 {
     return new Issue(_tenantId, issueId, _id, description, summary, IssueType.Defect);
 }
Ejemplo n.º 8
0
 public IssueCreated(
     TenantId tenantId1,
     IssueId issueId1,
     ProductId productId1,
     string description1,
     string summary1,
     IssueType issueType)
 {
     // TODO: Complete member initialization
         this.tenantId = tenantId1.ToString();
         this.issueId = issueId1.ToString();
         this.productId = productId1.ToString();
         this.description = description1.ToString();
         this.summary = summary1.ToString();
         this.issueType = issueType.ToString();
 }
Ejemplo n.º 9
0
 public IssueConfirmed(IssueId issueId)
 {
     this.IssueId = issueId.ToString();
 }
Ejemplo n.º 10
0
 private void When(IssueCreated e)
 {
     _id = new IssueId(e.issueId);
     ProductId = new ProductId(e.productId);
     _state = State.Pending;
     _type = (IssueType)Enum.Parse(typeof(IssueType), e.issueType);
     _description = e.description;
     _summary = e.summary;
 }
Ejemplo n.º 11
0
 public Issue ReportDefect(IssueId issueId, string descrption, string summary)
 {
     return(new Issue(_tenantId, issueId, _id, description, summary, IssueType.Defect));
 }
Ejemplo n.º 12
0
 public IssueConfirmed(IssueId issueId)
 {
     this.IssueId = issueId.ToString();
 }
Ejemplo n.º 13
0
 public Issue(TenantId tenantId, IssueId issueId, ProductId productId, string description, string summary, IssueType type)
     : this()
 {
     ApplyChange(new IssueCreated(tenantId, issueId, productId, description, summary, type));
 }
Ejemplo n.º 14
0
 public Issue RequestFeature(IssueId issueId, string descrption, string summary)
 {
     return(new Issue(_tenantId, issueId, _id, description, summary, IssueType.Feature));
 }
Ejemplo n.º 15
0
 public IssueFixed(IssueId _id, string resolution)
 {
     // TODO: Complete member initialization
     this._id        = _id;
     this.resolution = resolution;
 }