Пример #1
0
 public ExecuteTest()
 {
     SampleUser = new ExecuteUser
     {
         Key = "1".ToGuid(),
         Login = "******",
         Name = "Márvio André Bezerra Silverio"
     };
 }
Пример #2
0
        public Execute(Execute execute, ExecuteUser user)
        {
            Messages   = new List <ExecuteMessage>();
            Properties = new Dictionary <string, object>();

            User = user ?? execute?.User;

            if (execute != null)
            {
                AddMessage(execute);
            }
        }
		public async Task SignInAsync(TicketEntity signUpTicket)
		{
            if (signUpTicket != null && signUpTicket.Status == TicketStatus.Sucess)
            {
                IsAuthenticated = true;
                Culture = signUpTicket.Culture;
                UserKey = signUpTicket.Key;
                User = new ExecuteUser
                {
                    Key = signUpTicket.Key,
                    Name = signUpTicket.Name,
                    Login = "******"
                };

                return;
            }

            await SignOutAsync();
		}
Пример #4
0
 public Execute(ExecuteUser user)
     : this(null, user)
 {
 }
Пример #5
0
        public void ConstructorExecuteUserMessagesPlusUser()
        {
            Execute prioExecute = new Execute(SampleUser);

            prioExecute.AddMessage(ExecuteMessageType.Error, "Error message");
            prioExecute.AddMessage(ExecuteMessageType.Warning, "Warning message");
            prioExecute.AddMessage(ExecuteMessageType.Exception, "Exception message");

            ExecuteUser user = new ExecuteUser
            {
                Key = "2".ToGuid(),
                Login = "******",
                Name = "Jonhy"
            };

            Execute execute = new Execute(prioExecute, user);

            execute.HasErro.Should().Be(true, "There is error message");
            execute.HasWarning.Should().Be(true, "There is warning message");
            execute.HasException.Should().Be(true, "There is exception message");

            execute.User.Should().NotBe(null, "The user was infomed");
            execute.User.Should().Be(user, "The expected user is Jonhy");

            execute.Messages.Should().NotBeNull("Messages never can be null");
            execute.Messages.Count.Should().Be(3, "There isn't messages");
        }