Esempio n. 1
0
        public void Convert()
        {
            var context = new Mock <IContextAware>();
            {
                context.Setup(c => c.IsSynchronized)
                .Returns(true);
            }

            var progressTracker = new Mock <ITrackSteppingProgress>();
            var projectLink     = new Mock <ILinkToProjects>();
            var proxy           = new Mock <IProxyDataset>();
            {
                proxy.Setup(p => p.IsActivated)
                .Returns(true);
            }

            var dataset   = new DatasetFacade(proxy.Object);
            var model     = new DatasetModel(context.Object, progressTracker.Object, projectLink.Object, dataset);
            var vertex    = new DatasetViewVertex(context.Object, model);
            var converter = new DatasetViewVertexToDatasetModelConverter();
            var obj       = converter.Convert(vertex, null, null, null) as DatasetModel;

            Assert.AreSame(model, obj);
        }
        public void Convert()
        {
            var context = new Mock<IContextAware>();
            {
                context.Setup(c => c.IsSynchronized)
                    .Returns(true);
            }

            var progressTracker = new Mock<ITrackSteppingProgress>();
            var projectLink = new Mock<ILinkToProjects>();
            var proxy = new Mock<IProxyDataset>();
            {
                proxy.Setup(p => p.IsActivated)
                    .Returns(true);
            }

            var dataset = new DatasetFacade(proxy.Object);
            var model = new DatasetModel(context.Object, progressTracker.Object, projectLink.Object, dataset);
            var vertex = new DatasetViewVertex(context.Object, model);
            var converter = new DatasetViewVertexToDatasetModelConverter();
            var obj = converter.Convert(vertex, null, null, null) as DatasetModel;

            Assert.AreSame(model, obj);
        }
Esempio n. 3
0
        public void ConvertWithIncorrectTypeOfValue()
        {
            var converter = new DatasetViewVertexToDatasetModelConverter();

            Assert.Throws <InvalidOperationException>(() => converter.Convert(new object(), null, null, null));
        }
Esempio n. 4
0
        public void ConvertWithNullValue()
        {
            var converter = new DatasetViewVertexToDatasetModelConverter();

            Assert.Throws <InvalidOperationException>(() => converter.Convert(null, null, null, null));
        }
 public void ConvertWithNullValue()
 {
     var converter = new DatasetViewVertexToDatasetModelConverter();
     Assert.Throws<InvalidOperationException>(() => converter.Convert(null, null, null, null));
 }
 public void ConvertWithIncorrectTypeOfValue()
 {
     var converter = new DatasetViewVertexToDatasetModelConverter();
     Assert.Throws<InvalidOperationException>(() => converter.Convert(new object(), null, null, null));
 }