diff --git a/TheCyclopsProject/TheCyclopsTests/BusinessLogicsContractsTests/InstallationBusinessLogicContractTest.cs b/TheCyclopsProject/TheCyclopsTests/BusinessLogicsContractsTests/InstallationBusinessLogicContractTest.cs index 78ae462..d3cbe8a 100644 --- a/TheCyclopsProject/TheCyclopsTests/BusinessLogicsContractsTests/InstallationBusinessLogicContractTest.cs +++ b/TheCyclopsProject/TheCyclopsTests/BusinessLogicsContractsTests/InstallationBusinessLogicContractTest.cs @@ -305,15 +305,14 @@ internal class InstallationBusinessLogicContractTest [Test] public void InsertInstallation_CorrectRecord_Test() { - //Arrange var flag = false; - var record = new InstallationDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), DateTime.UtcNow, 10, 0, false, + var record = new InstallationDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), DateTime.UtcNow, 10, 10, false, [new InstallationComponentDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 5)]); _installationStorageContract.Setup(x => x.AddElement(It.IsAny())) .Callback((InstallationDataModel x) => { flag = x.Id == record.Id && x.EmployeeId == record.EmployeeId && - x.InstallationDate == record.InstallationDate && x.Sum == record.Sum && + x.InstallationDate == record.InstallationDate && x.Sum == record.Sum && x.IsCanceled == record.IsCanceled && x.Components.Count == record.Components.Count && x.Components.First().ComponentId == record.Components.First().ComponentId && x.Components.First().InstallationId == record.Components.First().InstallationId && @@ -333,7 +332,7 @@ internal class InstallationBusinessLogicContractTest _installationStorageContract.Setup(x => x.AddElement(It.IsAny())).Throws(new ElementExistsException("Data", "Data")); //Act&Assert Assert.That(() => _installationBusinessLogicContract.InsertInstallation(new(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), - DateTime.UtcNow, 10, 0, false, [new InstallationComponentDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 5)])), Throws.TypeOf()); + DateTime.UtcNow, 10, 10, false, [new InstallationComponentDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 5)])), Throws.TypeOf()); _installationStorageContract.Verify(x => x.AddElement(It.IsAny()), Times.Once); } @@ -360,7 +359,7 @@ internal class InstallationBusinessLogicContractTest _installationStorageContract.Setup(x => x.AddElement(It.IsAny())).Throws(new StorageException(new InvalidOperationException())); //Act&Assert Assert.That(() => _installationBusinessLogicContract.InsertInstallation(new(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), - DateTime.UtcNow, 10, 0, false, [new InstallationComponentDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 5)])), Throws.TypeOf()); + DateTime.UtcNow, 10, 10, false, [new InstallationComponentDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 5)])), Throws.TypeOf()); _installationStorageContract.Verify(x => x.AddElement(It.IsAny()), Times.Once); }