Пример #1
0
        public WhenRevoking()
        {
            _tokenProvider = new Mock<ITokenProvider>();
 
            _registry = new Mock<IDeviceRegistry>();
            _registry.Setup(x => x.AddOrUpdateAsync(It.IsAny<DeviceInfo>()))
                .ReturnsAsync(true);
            
            _controller = new ProvisionController(_tokenProvider.Object, _registry.Object);
        }
        public WhenProvisioning()
        {
            _tokenProvider = new Mock<ITokenProvider>();
            _tokenProvider.Setup(x => x.GetTokenAsync(It.IsAny<string>()))
                .ReturnsAsync(TOKEN);
            _tokenProvider.Setup(x => x.EndpointUri).Returns(new Uri("http://example.com"));

            _registry = new Mock<IDeviceRegistry>();
            _registry.Setup(x => x.AddOrUpdateAsync(It.IsAny<DeviceInfo>()))
                .ReturnsAsync(true);
            
            _controller = new ProvisionController(_tokenProvider.Object, _registry.Object);
        }