public static ReportingPeriodModelWrapper GetDummyReportingPeriodModelWrapper()
        {
            var result = new ReportingPeriodModelWrapper
            {
                UnitOfTime         = A.Dummy <ReportingPeriod>(),
                CalendarUnitOfTime = A.Dummy <CalendarReportingPeriod>(),
                CalendarDay        = A.Dummy <CalendarDayReportingPeriod>(),
                CalendarMonth      = A.Dummy <CalendarMonthReportingPeriod>(),
                CalendarQuarter    = A.Dummy <CalendarQuarterReportingPeriod>(),
                CalendarUnbounded  = A.Dummy <CalendarUnboundedReportingPeriod>(),
                CalendarYear       = A.Dummy <CalendarYearReportingPeriod>(),
                FiscalUnitOfTime   = A.Dummy <FiscalReportingPeriod>(),
                FiscalMonth        = A.Dummy <FiscalMonthReportingPeriod>(),
                FiscalQuarter      = A.Dummy <FiscalQuarterReportingPeriod>(),
                FiscalUnbounded    = A.Dummy <FiscalUnboundedReportingPeriod>(),
                FiscalYear         = A.Dummy <FiscalYearReportingPeriod>(),
                GenericUnitOfTime  = A.Dummy <GenericReportingPeriod>(),
                GenericMonth       = A.Dummy <GenericMonthReportingPeriod>(),
                GenericQuarter     = A.Dummy <GenericQuarterReportingPeriod>(),
                GenericUnbounded   = A.Dummy <GenericUnboundedReportingPeriod>(),
                GenericYear        = A.Dummy <GenericYearReportingPeriod>(),
            };

            return(result);
        }
        public static void ReportingPeriodModelWrapper_with_nulls___Should_roundtrip_to_json_and_back___When_using_ReportingPeriodStringSerializerBackedJsonConverter()
        {
            // Arrange
            var expected = new ReportingPeriodModelWrapper();

            var json = JsonConvert.SerializeObject(expected);

            // Act
            var actual = JsonConvert.DeserializeObject <ReportingPeriodModelWrapper>(json);

            // Assert
            actual.AsTest().Must().BeEqualTo(expected);
        }
Exemplo n.º 3
0
        public static void ReportingPeriodModelWrapper_with_nulls___Should_roundtrip_to_bson_and_back___When_using_ReportingPeriodBsonSerializer()
        {
            // Arrange
            var expected = new ReportingPeriodModelWrapper();

            var bson = expected.ToBsonDocument();

            // Act
            var actual = BsonSerializer.Deserialize <ReportingPeriodModelWrapper>(bson);

            // Assert
            actual.AsTest().Must().BeEqualTo(expected);
        }
        public static void ReportingPeriodModelWrapper_with_nulls___Should_roundtrip_to_property_bag_and_back___When_using_ReportingPeriodStringSerializer()
        {
            // Arrange
            var expected = new ReportingPeriodModelWrapper();

            var propertyBag = PropertyBagSerializer.SerializeToString(expected);

            // Act
            var actual = PropertyBagSerializer.Deserialize <ReportingPeriodModelWrapper>(propertyBag);

            // Assert
            actual.AsTest().Must().BeEqualTo(expected);
        }