Esempio n. 1
0
        public void Contains_TerminalContained_True()
        {
            DataStoreMock
            .Setup(_ => _.Contains(TerminalDescriptor))
            .Returns(true);

            var result = TestInstance.Contains(TerminalDescriptor);

            Assert.IsTrue(result);
        }
Esempio n. 2
0
        public void Contains_TerminalNotContained_False()
        {
            DataStoreMock
            .Setup(_ => _.Contains(TerminalDescriptor))
            .Returns(false);

            var result = TestInstance.Contains(TerminalDescriptor);

            Assert.IsFalse(result);
        }
Esempio n. 3
0
        public void Retrieve_TerminalDescriptor_ProxyDataStore()
        {
            DataStoreMock
            .Setup(_ => _.Retrieve(TerminalDescriptor))
            .Returns(Data)
            .Verifiable();

            var result = TestInstance.Retrieve(TerminalDescriptor);

            DataStoreMock.Verify();
            Assert.AreSame(Data, result);
        }
Esempio n. 4
0
        public void RetrieveAllDescriptors__NonTerminalDescriptorsRetrieved()
        {
            var nonTerminalDescriptorMocks = ArraysHelper.CreateWithContent(new Mock <INonTerminalDescriptor>(), new Mock <INonTerminalDescriptor>());
            var nonTerminalDescriptors     = nonTerminalDescriptorMocks.Select(_ => _.Object);

            DataStoreMock.Setup(_ => _.RetrieveDescriptors()).Returns(new ITerminalDescriptor[0]);
            CompositionsMock.Setup(_ => _.RetrieveDescriptors()).Returns(nonTerminalDescriptors).Verifiable();

            var result = (IEnumerable <IDescriptor>)ReflectionHelper.Invoke(TestInstance, "RetrieveAllDescriptors");

            CompositionsMock.Verify();
            Assert.IsTrue(nonTerminalDescriptors.Equivalent(result));
        }
Esempio n. 5
0
 public CodesDisplayViewModelTest() : base()
 {
     DataStoreMock.Setup(d => d.GetAllAsync()).Returns(Task.FromResult(TestGenerators.ToList()));
 }