Exemple #1
0
                public async Task NullUser_Throws()
                {
                    var validator = new UserSecurityStampRequiredValidator <User>();

                    await Assert.ThrowsAsync <ArgumentNullException>("user", async() =>
                    {
                        await validator.Validate(user: null);
                    });
                }
                public async Task ValidUser_Succeeds()
                {
                    var validator = new UserSecurityStampRequiredValidator <User>();
                    var user      = new User()
                    {
                        SecurityStamp = "stamp"
                    };

                    await validator.Validate(user);
                }
                public async Task EmptySecurityStamp_Throws()
                {
                    var validator = new UserSecurityStampRequiredValidator <User>();
                    var user      = new User()
                    {
                        SecurityStamp = string.Empty,
                    };

                    await Assert.ThrowsAsync <ArgumentException>("user", async() =>
                    {
                        await validator.Validate(user);
                    });
                }