Exemplo n.º 1
0
        public void Write_WithoutParametersSet_WritesCalculationWithOnlyEmptyStochasts()
        {
            // Setup
            string filePath = TestHelper.GetScratchPadPath(nameof(Write_WithoutParametersSet_WritesCalculationWithOnlyEmptyStochasts));

            try
            {
                var writer = new SimpleStructureCalculationConfigurationWriter(filePath, false);

                // Call
                writer.Write(new[]
                {
                    new SimpleStructuresCalculationConfiguration("some name")
                });

                // Assert
                string actualXml   = File.ReadAllText(filePath);
                string expectedXml = GetTestFileContent("structureCalculationWithoutParametersSet.xml");
                Assert.AreEqual(expectedXml, actualXml);
            }
            finally
            {
                File.Delete(filePath);
            }
        }
Exemplo n.º 2
0
        public void Write_WithoutConfigurations_ThrowsArgumentNullException()
        {
            // Setup
            string filePath = TestHelper.GetScratchPadPath("test.xml");

            var writer = new SimpleStructureCalculationConfigurationWriter(filePath, false);
            {
                // Call
                TestDelegate test = () => writer.Write(null);

                // Assert
                var exception = Assert.Throws <ArgumentNullException>(test);
                Assert.AreEqual("configurations", exception.ParamName);
            }
        }