public void AsBoolean1_IgnoresFallbackValue()
        {
            // Arrange
            IJsonObject json = JsonObject.Of(false);

            // Act
            // Assert
            Assert.That(json.AsBoolean(true), Is.False);
        }
Esempio n. 2
0
        public void AsBoolean1_ReturnsFallback()
        {
            // Arrange
            IJsonObject json = JsonObject.Of(0);

            // Act
            // Assert
            Assert.That(json.AsBoolean(true), Is.True);
        }
        public void AsBoolean_ThrowsException()
        {
            // Arrange
            IJsonObject json = JsonObject.FromString("{}");

            // Act
            // Assert
            Assert.Throws <ApplicationException>(() => json.AsBoolean());
        }
        public void AsBoolean_ReturnsValue()
        {
            // Arrange
            IJsonObject json0 = JsonObject.Of(true);
            IJsonObject json1 = JsonObject.Of(false);

            // Act
            // Assert
            Assert.That(json0.AsBoolean(), Is.True);
            Assert.That(json1.AsBoolean(), Is.False);
        }
Esempio n. 5
0
        public void AsBoolean_ThrowsException()
        {
            // Arrange
            IJsonObject json = JsonObject.Of(1);

            // Act
            // Assert
            Assert.Throws <ApplicationException>(() =>
            {
                json.AsBoolean();
            });
        }