示例#1
0
        public void Should_WriteEvent_When_EventEnumIsProvided()
        {
            var mockWriter = Mock.Of <JsonWriter>();
            var sut        = new InsightTypeInsightsConverter();

            sut.WriteJson(mockWriter, InsightType.Event, new JsonSerializer());
            Mock.Get(mockWriter).Verify(mock => mock.WriteValue((object)"EVENT"), Times.Once);
        }
示例#2
0
        public void Should_WriteNull_When_NullObjectIsProvided()
        {
            var mockWriter = Mock.Of <JsonWriter>();
            var sut        = new InsightTypeInsightsConverter();

            sut.WriteJson(mockWriter, null, new JsonSerializer());
            Mock.Get(mockWriter).Verify(mock => mock.WriteNull(), Times.Once);
        }
示例#3
0
        public void Should_ReturnFalse_When_EnumIsProvided()
        {
            var sut = new InsightTypeInsightsConverter();

            Assert.IsFalse(sut.CanConvert(typeof(Enum)));
        }
示例#4
0
        public void Should_ReturnTrue_When_InsightTypeEnumIsProvided()
        {
            var sut = new InsightTypeInsightsConverter();

            Assert.IsTrue(sut.CanConvert(typeof(InsightType)));
        }