Beispiel #1
0
        public void ArePropertiesAndValuesValid(String deviceId, Boolean shouldBeValid)
        {
            Mock <ISerializer> serializerMock = new Mock <ISerializer>(MockBehavior.Strict);

            serializerMock.Setup(x => x.Deserialze <String>(deviceId)).Returns(deviceId).Verifiable();

            var     resolver = new DeviceBasedDHCPv6PeerAddressResolver(Mock.Of <IDeviceService>(MockBehavior.Strict));
            Boolean actual   = resolver.ArePropertiesAndValuesValid(new Dictionary <String, String> {
                { "DeviceId", deviceId },
            }, serializerMock.Object);

            Assert.Equal(shouldBeValid, actual);

            serializerMock.Verify();
        }
Beispiel #2
0
        public void ArePropertiesAndValuesValid_KeyIsMissing()
        {
            var input = new[] {
                new  Dictionary <String, String> {
                    { "DeviceId2", "someVaue" },
                },
            };

            var resolver = new DeviceBasedDHCPv6PeerAddressResolver(Mock.Of <IDeviceService>(MockBehavior.Strict));

            foreach (var item in input)
            {
                Boolean actual = resolver.ArePropertiesAndValuesValid(item, Mock.Of <ISerializer>(MockBehavior.Strict));
                Assert.False(actual);
            }
        }