Exemplo n.º 1
0
        public void NullForCtorArgumentsThrowsException(IFixture fixture, Name name)
        {
            fixture.Inject <ParameterMeta>(ParameterMeta.Create <IParameter>(name));
            var assertion = new GuardClauseAssertion(fixture);

            assertion.Verify(typeof(CmdApplicationMeta).GetConstructors());
        }
Exemplo n.º 2
0
        public void CtorParametersAreInitialized(IFixture fixture, Name name)
        {
            fixture.Inject <ParameterMeta>(ParameterMeta.Create <IParameter>(name));
            var assertion = new ConstructorInitializedMemberAssertion(fixture);

            assertion.Verify(typeof(CmdApplicationMeta));
        }
 private CmdApplicationMeta GetApplicationConfigurationMeta()
 {
     return(new CmdApplicationMeta(
                (Name)"FriendlyName",
                (Name)"ApplicationName",
                new List <ParameterMeta>()
     {
         ParameterMeta.Create <NameOnlyParameter>((Name)"aParameter"),
         ParameterMeta.Create <NameValueParameter>((Name)"anotherParameter")
     }));
 }
Exemplo n.º 4
0
        public void CreateWithInvalidParameterMetaTypeThrowsException(
            Name name,
            Name applicationName,
            Name parameterName,
            IChannel <SaveCmdApplicationConfigurationCommand> channel,
            CmdApplicationConfigurationViewModelFactory sut)
        {
            var parameter = new Mock <IParameter>();
            var meta      = new CmdApplicationMeta(
                name,
                applicationName,
                new List <ParameterMeta>()
            {
                ParameterMeta.Create <IParameter>(parameterName)
            });

            Assert.Throws <ArgumentException>(() => sut.Create(meta));
        }
Exemplo n.º 5
0
        public void SutWithDisplayNameReturnsName(Name aName, Name aDisplayName)
        {
            var sut = ParameterMeta.Create <ParameterTest>(aName, aDisplayName);

            Assert.Equal(aDisplayName, sut.DisplayName);
        }
Exemplo n.º 6
0
        public void SutWithDefaultDisplayNameReturnsEmptyName(Name aName)
        {
            var sut = ParameterMeta.Create <ParameterTest>(aName);

            Assert.Equal(Name.EmptyName, sut.DisplayName);
        }
Exemplo n.º 7
0
        public void ParameterTypeExposesTheCorrectType(Name name)
        {
            var sut = ParameterMeta.Create <ParameterTest>(name);

            Assert.Equal(typeof(ParameterTest), sut.ParameterType);
        }
Exemplo n.º 8
0
 public void NullForCtorArgumentsThrowsException(IFixture fixture)
 {
     Assert.Throws <ArgumentNullException>(() => ParameterMeta.Create <IParameter>(null));
 }