Exemple #1
0
        public void CreateForSetRequiredSigner_WhenRegistrationIsNull_Throws()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => PackageRegistrationAuditRecord.CreateForSetRequiredSigner(
                    registration: null,
                    previousRequiredSigner: "a",
                    newRequiredSigner: "b"));

            Assert.Equal("registration", exception.ParamName);
        }
Exemple #2
0
        public void CreateForSetRequiredSigner_InitializesProperties(RequiredSignerTest test)
        {
            var record = PackageRegistrationAuditRecord.CreateForSetRequiredSigner(
                test.PackageRegistration, test.PreviousRequiredSigner, test.NewRequiredSigner);

            Assert.Equal(AuditedPackageRegistrationAction.SetRequiredSigner, record.Action);
            Assert.Equal(test.PackageRegistration.Id, record.Id);
            Assert.Equal(test.PreviousRequiredSigner, record.PreviousRequiredSigner);
            Assert.Equal(test.NewRequiredSigner, record.NewRequiredSigner);
            Assert.Null(record.Owner);
            Assert.Equal(test.PackageRegistration.Id, record.RegistrationRecord.Id);
        }