public void ListWithOneChildSecurity()
        {
            var listingDate = new Date(2000, 01, 01);

            var stock = new StapledSecurity(Guid.NewGuid());

            var childSecurities = new StapledSecurityChild[]
            {
                new StapledSecurityChild("ABC_1", "Child 1", true)
            };

            stock.List("ABC", "ABC Pty Ltd", listingDate, AssetCategory.AustralianProperty, childSecurities);

            using (new AssertionScope())
            {
                stock.Should().BeEquivalentTo(new
                {
                    Trust           = false,
                    EffectivePeriod = new DateRange(listingDate, Date.MaxValue)
                });

                stock.RelativeNTAs[listingDate].Percentages.Should().Equal(new decimal[] { 1.00m });

                stock.ChildSecurities.Should().SatisfyRespectively(
                    first => first.Should().BeEquivalentTo(new
                {
                    AsxCode = "ABC_1",
                    Name    = "Child 1",
                    Trust   = true
                }));
            }
        }
        public void DeList()
        {
            var listingDate   = new Date(2000, 01, 01);
            var delistingDate = new Date(2002, 01, 01);

            var stock = new StapledSecurity(Guid.NewGuid());

            stock.List("ABC", "ABC Pty Ltd", listingDate, AssetCategory.AustralianProperty, new StapledSecurityChild[0]);
            stock.DeList(delistingDate);

            using (new AssertionScope())
            {
                stock.Should().BeEquivalentTo(new
                {
                    Trust           = false,
                    EffectivePeriod = new DateRange(listingDate, delistingDate)
                });

                stock.Properties.Values.Last().EffectivePeriod.ToDate.Should().Be(delistingDate);
                stock.DividendRules.Values.Last().EffectivePeriod.ToDate.Should().Be(delistingDate);
                stock.RelativeNTAs.Values.Last().EffectivePeriod.ToDate.Should().Be(delistingDate);
            }
        }
        public void ListWithoutChildSecurities()
        {
            var listingDate = new Date(2000, 01, 01);

            var stock = new StapledSecurity(Guid.NewGuid());

            stock.List("ABC", "ABC Pty Ltd", listingDate, AssetCategory.AustralianProperty, new StapledSecurityChild[0]);

            using (new AssertionScope())
            {
                stock.Should().BeEquivalentTo(new
                {
                    Trust           = false,
                    EffectivePeriod = new DateRange(listingDate, Date.MaxValue)
                });

                stock.Properties[listingDate].Should().BeEquivalentTo(new
                {
                    AsxCode  = "ABC",
                    Name     = "ABC Pty Ltd",
                    Category = AssetCategory.AustralianProperty
                });

                // Check default values are set
                stock.DividendRules[listingDate].Should().BeEquivalentTo(new
                {
                    CompanyTaxRate       = 0.30m,
                    DividendRoundingRule = RoundingRule.Round,
                    DrpActive            = false,
                    DrpMethod            = DrpMethod.Round
                });

                stock.RelativeNTAs[listingDate].Percentages.Should().BeEmpty();

                stock.ChildSecurities.Should().BeEmpty();
            }
        }