コード例 #1
0
        public void GetFieldValue_NullField_Throws()
        {
            var crossSection = new CrossSectionSurvey();

            TestDelegate testDelegate = () => crossSection.GetFieldValue(null);

            Assert.That(testDelegate, Throws.Exception.TypeOf <ArgumentNullException>());
        }
コード例 #2
0
        public void GetFieldValue_FieldDoesNotExist_Throws()
        {
            var crossSection = new CrossSectionSurvey();

            const string field = "SomeKey";

            TestDelegate testDelegate = () => crossSection.GetFieldValue(field);

            Assert.That(testDelegate, Throws.Exception.TypeOf <CrossSectionCsvFormatException>().With.Message.Contains(field));
        }
コード例 #3
0
        public void GetFieldValue_FieldExists_ReturnsExpectedValue()
        {
            var crossSection = new CrossSectionSurvey();

            const string field = "SomeKey";
            const string data  = "value";

            crossSection.Fields.Add(field, data);

            var result = crossSection.GetFieldValue(field);

            Assert.That(result, Is.EqualTo(data));
        }
コード例 #4
0
 private static string GetLocationIdentifier(CrossSectionSurvey crossSectionSurvey)
 {
     return(crossSectionSurvey.GetFieldValue(CrossSectionDataFields.Location));
 }