public void Contains_TerminalContained_True() { DataStoreMock .Setup(_ => _.Contains(TerminalDescriptor)) .Returns(true); var result = TestInstance.Contains(TerminalDescriptor); Assert.IsTrue(result); }
public void Contains_TerminalNotContained_False() { DataStoreMock .Setup(_ => _.Contains(TerminalDescriptor)) .Returns(false); var result = TestInstance.Contains(TerminalDescriptor); Assert.IsFalse(result); }
public void Retrieve_TerminalDescriptor_ProxyDataStore() { DataStoreMock .Setup(_ => _.Retrieve(TerminalDescriptor)) .Returns(Data) .Verifiable(); var result = TestInstance.Retrieve(TerminalDescriptor); DataStoreMock.Verify(); Assert.AreSame(Data, result); }
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)); }
public CodesDisplayViewModelTest() : base() { DataStoreMock.Setup(d => d.GetAllAsync()).Returns(Task.FromResult(TestGenerators.ToList())); }