public void SetUp()
 {
     _mockFileHelper = new Mock<IFileSystemHelper>();
     _mockXmlSerializtionHelper = new Mock<IXmlSerializtionHelper>();
     _networkMapProvider = new NetworkMapProvider(_mockFileHelper.Object, _mockXmlSerializtionHelper.Object);
 }
        public void Open_Sucessfull()
        {
            //Arrange
            const string filePath = "SomeFile.xml";
            const string fileText = "Some fake xml";
            var providerResults = new NetworkMapProvider();
            providerResults.Nodes.Add(new NetworkNode());
            providerResults.Connections.Add(new NodeConnection());
            _mockFileHelper.Setup(f => f.ReadAllText(filePath)).Returns(fileText);
            _mockXmlSerializtionHelper
                .Setup(s => s.Deserialize<NetworkMapProvider>(fileText))
                .Returns(providerResults);

            //Act
            _networkMapProvider.Open(filePath);

            //Assert
            Assert.AreEqual(1, _networkMapProvider.Nodes.Count);
            Assert.AreEqual(1, _networkMapProvider.Connections.Count);
            _mockFileHelper.VerifyAll();
            _mockXmlSerializtionHelper.VerifyAll();
        }