public void SetRelativeNTAsAfterDeListing()
        {
            var listingDate   = new Date(2000, 01, 01);
            var delistingDate = new Date(2001, 01, 01);
            var changeDate    = new Date(2002, 01, 01);

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

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

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

            Action a = () => stock.SetRelativeNTAs(changeDate, new decimal[] { 0.50m, 0.50m });

            a.Should().Throw <EffectiveDateException>();
        }
        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);
            }
        }