Beispiel #1
0
        public void TestThatCreateGetCommandReturnsSqlQueryForId()
        {
            Guid identifier = Guid.NewGuid();

            IStorageProxy sut = CreateSut(identifier);

            Assert.That(sut, Is.Not.Null);

            // ReSharper disable StringLiteralTypo
            new DbCommandTestBuilder("SELECT s.StorageIdentifier,s.HouseholdIdentifier,s.SortOrder,s.StorageTypeIdentifier,s.Descr,s.Temperature,s.CreationTime,h.Name AS HouseholdName,h.Descr AS HouseholdDescr,h.CreationTime AS HouseholdCreationTime,st.SortOrder AS StorageTypeSortOrder,st.Temperature AS StorageTypeTemperature,st.TemperatureRangeStartValue AS StorageTypeTemperatureRangeStartValue,st.TemperatureRangeEndValue AS StorageTypeTemperatureRangeEndValue,st.Creatable AS StorageTypeCreatable,st.Editable AS StorageTypeEditable,st.Deletable AS StorageTypeDeletable FROM Storages AS s INNER JOIN Households AS h ON h.HouseholdIdentifier=s.HouseholdIdentifier INNER JOIN StorageTypes AS st ON st.StorageTypeIdentifier=s.StorageTypeIdentifier WHERE s.StorageIdentifier=@storageIdentifier")
            // ReSharper restore StringLiteralTypo
            .AddCharDataParameter("@storageIdentifier", identifier)
            .Build()
            .Run(sut.CreateGetCommand());
        }