public void Table1(
            string specialty,
            decimal value,
            string unit,
            string statistic)
        {
            // Arrange
            IAbstractFactory abstractFactory = AbstractFactory.Create();

            IDependenciesAbstractFactory dependenciesAbstractFactory = abstractFactory.CreateDependenciesAbstractFactory();

            ISurgicalDurationInputContext surgicalDurationInputContext = abstractFactory.CreateContextsAbstractFactory().CreateSurgicalDurationInputContextFactory().Create(
                specialty: dependenciesAbstractFactory.CreateCodeableConceptFactory().Create(specialty, SNOMEDCT, null),
                statistic: dependenciesAbstractFactory.CreateValueFactory().Create(statistic));

            ISurgicalDurationExport surgicalDurationExport = abstractFactory.CreateExportsAbstractFactory().CreateSurgicalDurationExportFactory().Create();

            // Act
            ISurgicalDurationOutputContext surgicalDurationOutputContext = surgicalDurationExport.GetSurgicalDuration(
                abstractFactory,
                surgicalDurationInputContext);

            // Assert
            Assert.AreEqual(
                expected: value,
                actual: surgicalDurationOutputContext.Duration.Value.Value);

            Assert.AreEqual(
                expected: unit,
                actual: surgicalDurationOutputContext.Duration.UnitElement.Value);
        }
        public void InvalidSurgicalSpecialtyStdDev()
        {
            // Arrange
            IAbstractFactory abstractFactory = AbstractFactory.Create();

            IDependenciesAbstractFactory dependenciesAbstractFactory = abstractFactory.CreateDependenciesAbstractFactory();

            ISurgicalDurationInputContext surgicalDurationInputContext = abstractFactory.CreateContextsAbstractFactory().CreateSurgicalDurationInputContextFactory().Create(
                specialty: dependenciesAbstractFactory.CreateCodeableConceptFactory().Create(BoneAndMarrowTransplantationSurgery, SNOMEDCT, null),
                statistic: dependenciesAbstractFactory.CreateValueFactory().CreateStdDev());

            ISurgicalDurationExport surgicalDurationExport = abstractFactory.CreateExportsAbstractFactory().CreateSurgicalDurationExportFactory().Create();

            // Act
            Action action = () =>
            {
                ISurgicalDurationOutputContext surgicalDurationOutputContext = surgicalDurationExport.GetSurgicalDuration(
                    abstractFactory,
                    surgicalDurationInputContext);
            };

            // Assert
            Assert.ThrowsException <NullReferenceException>(
                action);
        }
Beispiel #3
0
 public ISurgicalDurationOutputContext GetSurgicalDuration(
     IAbstractFactory abstractFactory,
     ISurgicalDurationInputContext surgicalDurationInputContext)
 {
     return(abstractFactory.CreateContextsAbstractFactory().CreateSurgicalDurationOutputContextFactory().Create(
                abstractFactory.CreateSurgicalDurationsAbstractFactory()
                .CreateSurgicalDurationFactory(
                    surgicalDurationInputContext.Specialty)
                .Create(
                    abstractFactory.CreateDependenciesAbstractFactory().CreateDurationFactory())
                .GetValue(
                    surgicalDurationInputContext.Statistic)));
 }
        public ISurgicalDurationInputContext Create(
            CodeableConcept specialty,
            IValue <string> statistic)
        {
            ISurgicalDurationInputContext context = null;

            try
            {
                context = new SurgicalDurationInputContext(
                    specialty,
                    statistic);
            }
            finally
            {
            }

            return(context);
        }
        public void EarNoseThroatSurgeryInvalidStatistic()
        {
            // Arrange
            IAbstractFactory abstractFactory = AbstractFactory.Create();

            IDependenciesAbstractFactory dependenciesAbstractFactory = abstractFactory.CreateDependenciesAbstractFactory();

            ISurgicalDurationInputContext surgicalDurationInputContext = abstractFactory.CreateContextsAbstractFactory().CreateSurgicalDurationInputContextFactory().Create(
                specialty: dependenciesAbstractFactory.CreateCodeableConceptFactory().CreateEarNoseThroatSurgery(),
                statistic: dependenciesAbstractFactory.CreateValueFactory().Create(skew));

            ISurgicalDurationExport surgicalDurationExport = abstractFactory.CreateExportsAbstractFactory().CreateSurgicalDurationExportFactory().Create();

            // Act
            ISurgicalDurationOutputContext surgicalDurationOutputContext = surgicalDurationExport.GetSurgicalDuration(
                abstractFactory,
                surgicalDurationInputContext);

            // Assert
            Assert.IsNull(
                surgicalDurationOutputContext.Duration);
        }