コード例 #1
0
        protected static Mock <ComponentInterface> CreateInterface(int interfaceNameValue)
        {
            var interfaceMock = new Mock <ComponentInterface>();

            interfaceMock.SetupGet(x => x.Id).Returns(Guid.NewGuid());
            interfaceMock.Setup(x => x.Name).Returns(NamesGenerator.ComponentInterfaceName(interfaceNameValue));
            return(interfaceMock);
        }
コード例 #2
0
        public void Constructor_Called_CanCreateComponentInterface()
        {
            //Arrange
            var name = NamesGenerator.ComponentInterfaceName();
            var componentInterface = new ComponentInterface(name);

            //Assert
            Assert.That(componentInterface.Name, Is.EqualTo(name));
        }
コード例 #3
0
        private static List <ComponentInterface> CreateSlots()
        {
            var slotsToInsert = new List <ComponentInterface>();

            for (var i = 0; i < 5; i++)
            {
                slotsToInsert.Add(new ComponentInterface(NamesGenerator.ComponentInterfaceName(i)));
            }
            return(slotsToInsert);
        }
コード例 #4
0
        public void Map_ComponentInterfaceVO()
        {
            var from = new ComponentInterfaceVO
            {
                Id   = Guid.NewGuid(),
                Name = NamesGenerator.ComponentInterfaceName()
            };
            var to = Mapper.Map <ComponentInterfaceModel>(from);

            AssertAllPropertiesSet(from, to);
            AssertLinksSet(to);
        }
コード例 #5
0
 private static ComponentInterfaceVO CreateInterfaceVO()
 {
     return(new ComponentInterfaceVO {
         Name = NamesGenerator.ComponentInterfaceName()
     });
 }