public void GetValue_NameDoesNotMatch_ReturnsEmptyResult()
    {
        // Arrange
        var culture       = new CultureInfo("fr-FR");
        var valueProvider = new ElementalValueProvider("foo", "hi", culture);

        // Act
        var result = valueProvider.GetValue("bar");

        // Assert
        Assert.Equal(ValueProviderResult.None, result);
    }
        public void GetValue_NameDoesNotMatch_ReturnsNull() {
            // Arrange
            CultureInfo culture = CultureInfo.GetCultureInfo("fr-FR");
            DateTime rawValue = new DateTime(2001, 1, 2);
            ElementalValueProvider valueProvider = new ElementalValueProvider("foo", rawValue, culture);

            // Act
            ValueProviderResult vpResult = valueProvider.GetValue("bar");

            // Assert
            Assert.IsNull(vpResult);
        }
Beispiel #3
0
        public void GetValue_NameDoesNotMatch_ReturnsNull()
        {
            // Arrange
            CultureInfo            culture       = CultureInfo.GetCultureInfo("fr-FR");
            DateTime               rawValue      = new DateTime(2001, 1, 2);
            ElementalValueProvider valueProvider = new ElementalValueProvider("foo", rawValue, culture);

            // Act
            ValueProviderResult vpResult = valueProvider.GetValue("bar");

            // Assert
            Assert.Null(vpResult);
        }
    public void GetValue_NameMatches_ReturnsValueProviderResult(string name)
    {
        // Arrange
        var culture       = new CultureInfo("fr-FR");
        var valueProvider = new ElementalValueProvider("foo", "hi", culture);

        // Act
        var result = valueProvider.GetValue(name);

        // Assert
        Assert.Equal("hi", (string)result);
        Assert.Equal(culture, result.Culture);
    }
        public void GetValue_NameMatches_ReturnsValueProviderResult() {
            // Arrange
            CultureInfo culture = CultureInfo.GetCultureInfo("fr-FR");
            DateTime rawValue = new DateTime(2001, 1, 2);
            ElementalValueProvider valueProvider = new ElementalValueProvider("foo", rawValue, culture);

            // Act
            ValueProviderResult vpResult = valueProvider.GetValue("FOO");

            // Assert
            Assert.IsNotNull(vpResult);
            Assert.AreEqual(rawValue, vpResult.RawValue);
            Assert.AreEqual("02/01/2001 00:00:00", vpResult.AttemptedValue);
            Assert.AreEqual(culture, vpResult.Culture);
        }
Beispiel #6
0
        public void GetValue_NameMatches_ReturnsValueProviderResult()
        {
            // Arrange
            CultureInfo            culture       = CultureInfo.GetCultureInfo("fr-FR");
            DateTime               rawValue      = new DateTime(2001, 1, 2);
            ElementalValueProvider valueProvider = new ElementalValueProvider("foo", rawValue, culture);

            // Act
            ValueProviderResult vpResult = valueProvider.GetValue("FOO");

            // Assert
            Assert.NotNull(vpResult);
            Assert.Equal(rawValue, vpResult.RawValue);
            Assert.Equal("02/01/2001 00:00:00", vpResult.AttemptedValue);
            Assert.Equal(culture, vpResult.Culture);
        }